Skip to content

Feature/memory opt#1159

Merged
qin-ctx merged 32 commits intomainfrom
feature/memory_opt
Apr 6, 2026
Merged

Feature/memory opt#1159
qin-ctx merged 32 commits intomainfrom
feature/memory_opt

Conversation

@chenjw
Copy link
Copy Markdown
Collaborator

@chenjw chenjw commented Apr 1, 2026

Description

  1. 遥测系统增强 (openviking/telemetry/)
  • 新增 tracer.py (542行) - 完整的追踪系统
  • init.py 中添加遥测初始化
  • 修复:添加 span ended 检查和 AsyncioInstrumentor 支持后台任务
  1. 内存系统优化 (openviking/session/memory/)
  • 重构 URI 处理和内存提取逻辑 (utils/uri.py)
  • 改进 memory_updater.py (78行变更)
  • 优化 extract_loop.py 和 tools.py
  • 新增 memory events 模板 (prompts/templates/memory/events.yaml)
  1. 会话支持 (openviking/session/, openviking/client/session.py)
  • 新增 created_at 支持 for add_message
  • 优化 compressor_v2.py
  1. VLM 后端更新
  • 统一调整 litellm_vlm.py, openai_vlm.py, volcengine_vlm.py 后端
  1. 配置与 CLI
  • 新增 telemetry 配置 (telemetry_config.py)
  • 更新 open_viking_config.py

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

chenjw and others added 5 commits March 30, 2026 21:37
Bot proxy endpoints (/chat, /chat/stream) previously required auth
unconditionally, while other endpoints like /find use get_request_context
which allows dev mode without API keys. This caused inconsistent behavior
where ov find worked but ov chat failed with 401.

Now bot endpoints use the same get_request_context dependency for
consistent auth behavior across all endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update URI utilities for better path handling
- Improve memory type registry and updater
- Enhance session extraction context provider
- Update memory prompt templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- bot/ov_server.py: pass message timestamp to session.add_message()
- client/session.py: pass created_at to underlying client
- sync_client.py: add created_at parameter to add_message()

When created_at is not provided, the server will use current time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ground tasks

- Add end_time check in tracer.info/set/error to avoid "Tried calling _add_event on an ended span"
- Add AsyncioInstrumentor to auto-create child spans for asyncio.create_task
- Add @tracer decorator to _run_memory_extraction for background task tracing
- Add opentelemetry-instrumentation-asyncio dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Failed to generate code suggestions for PR

chenjw and others added 4 commits April 1, 2026 22:21
The openviking/telemetry/langfuse.py was not being imported anywhere
in the openviking package. Project uses bot/vikingbot/integrations/langfuse.py
instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw requested review from qin-ctx and zhoujh01 April 2, 2026 04:50
chenjw and others added 2 commits April 2, 2026 13:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused sys import
- Sort import block alphabetically
- Remove unused span variable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw changed the title Feature/memory opt 【WIP】Feature/memory opt Apr 2, 2026
- 合并两个方法,统一模板渲染逻辑
- 添加extract_context参数支持模板渲染
- 添加[content_template]日志标签用于调试events渲染问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw changed the title 【WIP】Feature/memory opt 【WIP先别通过】Feature/memory opt Apr 2, 2026
@chenjw chenjw changed the title 【WIP先别通过】Feature/memory opt 【WIP,测试中,先别通过】Feature/memory opt Apr 2, 2026
chenjw and others added 10 commits April 2, 2026 16:25
1. tools.py: 导入缺失的 truncate_content 函数和 ToolContext 类型
2. tools.py: 修复 f-string 无占位符的问题
3. test_memory_utils.py: 删除引用不存在函数的测试

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit ede6192.
- 添加 soul.yaml 和 identity.yaml 记忆模板
- 在 MemoryField 中添加 init_value 字段支持默认值
- 在 directories.py 中添加初始化逻辑,当字段配置了 init_value 时自动创建记忆文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 从 JSON 数据 conversation 提取对话最晚时间作为问题时间
- prompt 注入 "Current date: {time}" 提升时间相关问题回答质量
- 添加 --question-index 参数支持单题测试
- 添加 --skip-import 参数支持跳过导入步骤
- 新增 import_and_eval_one.sh 脚本用于单题测试

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 简化 StructuredMemoryOperations 相关代码,移除旧版 fallback
- 修复 Jinja2 渲染 StrPatch 对象时调用 __str__ 的问题
- 统一文件存在/不存在逻辑,merge_op.apply 自动处理 current_value=None
- serialize_with_metadata 统一处理模板渲染
- 移除 _extract_replace_from_patch 等冗余方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chenjw and others added 8 commits April 5, 2026 01:14
- 优化 memory_updater.py 文件写入逻辑
- 修复模板渲染问题
- 更新 memory 模板文件 (entities, events, preferences, profile, soul, tools)
- 修复 language.py 相关问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 使用 question_id(如 conv-26_qa0)作为 session_id,每个 query 完全独立
- 恢复 --threads 参数,默认值 20,控制并发度

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- import_and_eval_one.sh: 添加 --skip-import 参数支持跳过导入
- run_eval.py: is_invalid 改为按问题内容匹配,支持 errors.json
- 调整 is_invalid 字段位置到 result 后面

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw changed the title 【WIP,测试中,先别通过】Feature/memory opt Feature/memory opt Apr 6, 2026
chenjw and others added 2 commits April 6, 2026 15:12
- 默认路径从 test_data 改为 data
- 添加 import_and_eval_one.sh 使用说明
- 添加 --skip-import 开关说明

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qin-ctx qin-ctx merged commit 7f05828 into main Apr 6, 2026
2 of 7 checks passed
@qin-ctx qin-ctx deleted the feature/memory_opt branch April 6, 2026 07:50
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Apr 6, 2026
zeattacker pushed a commit to zeattacker/OpenViking that referenced this pull request Apr 10, 2026
Upstream catch-up from volcengine/OpenViking main at a18d4b9.

Auto-merged (24 files): README, bot/config, crates/ov_cli, session/session.py,
session/compressor{,_v2}.py, session/memory_deduplicator.py, memory_extractor.py,
schema_model_generator.py, utils/uri.py, storage/viking_fs.py,
storage/transaction/lock_manager.py, storage/queuefs/semantic_processor.py,
retrieve/hierarchical_retriever.py, server/routers/content.py, server/routers/search.py,
core/directories.py, prompts/templates/memory/preferences.yaml,
examples/openclaw-plugin/{index,text-utils}.ts, examples/ov.conf.example,
openviking_cli/utils/config/{memory_config,open_viking_config}.py,
docs/en/concepts/08-session.md.

Hand-resolved conflicts (14 files):

Memory subsystem:
- entities.yaml: adopt upstream category field + event linking, keep our
  brain-hardening rules (canonical names, Aliases section, one-card-per-entity).
  Removed upstream's Caroline LoCoMo leak.
- events.yaml: adopt upstream year/month/day folder template.
- memory_updater.py: keep dev's two-function _apply_write/_apply_edit structure
  with collision-safe entity writes, port get_year/get_month/get_day helpers
  to ExtractContext for events.yaml template to work.
- session_extract_context_provider.py: keep dev's [Keywords] bug fix
  (_derive_search_keywords) — upstream volcengine#1159 did not address this.
- extract_loop.py: keep dev's small-model extraction path. Dev's hard_cap
  iteration extension is more sophisticated than upstream's version.

Storage:
- collection_schemas.py: combine dev's BGE-M3 truncation (30k chars) with
  upstream volcengine#1301 embed_compat async wrapper.
- queuefs/semantic_dag.py: combine dev's old_summary hash comparison with
  upstream's defensive null check on cached summary.
- queuefs/semantic_queue.py: keep dev's 300-second dedup window with
  _TrackedSemanticRequest dataclass.
- utils/summarizer.py: take upstream — convergent fix, upstream is superset
  of our context_type centralization plus resource cover handling.

Models:
- openai_vlm.py: merge timeout signature (float | None = 60.0).

Plugin (TypeScript):
- config.ts: keep dev's profileInjection/recallFormat/alignment fields,
  add upstream's bypassSessionPatterns deprecation alias.
- client.ts: merge addSessionMessage signature
  (sessionId, role, content, parts?, agentId?, createdAt?), keep dev's
  createSession(), combine body building with optional created_at.
- context-engine.ts: keep dev's driftDetector + alignment, add upstream's
  isBypassedSession helper + bypass early-return in doCommit/afterTurn.
  Drop upstream's inline afterTurn commit block — dev routes through
  doCommitOVSession. Update addSessionMessage call to 6-arg form.
- memory-ranking.ts: keep dev's multi-slot recall + tool-experience
  separation architecture.

Deferred upstream changes:
- volcengine#1221 agfs→ragfs Rust rewrite: new Rust crates land but Python code
  unchanged; pyagfs handles auto-fallback via RAGFS_IMPL env var.
- volcengine#1159 memory_updater unified operations refactor: kept dev's separate
  write/edit function structure to avoid cascading schema changes through
  extract_loop and related files.

Critical security + bug fixes preserved from upstream:
- volcengine#1319 leaked token removed from settings.py
- volcengine#1133 SSRF hardening on HTTP resource ingestion
- volcengine#1297 sanitize and cap recall queries (wraps our plugin recall)
- volcengine#1277 configurable embedding circuit breaker
- volcengine#1279 trusted mode without API key restricted to localhost
- volcengine#1211 PID lock recycle + ownership checks + compressor refs
- volcengine#1182 task API ownership leakage fix in content.py
- volcengine#1301 embedder async contention reduction
- volcengine#1226 prevent VLM blocking startup hang in redo recovery
- volcengine#769/volcengine#792 queuefs dedupe memory semantic parent enqueues

Critical dev fixes preserved:
- [Keywords] placeholder root-cause fix (brain-hardening plan phase 1)
- Episodic memory v2 (retrieval scope, category boosts, archive filter)
- Qwen-9B small-model extraction compatibility
- Plugin recall refactor (tool-experience separation, multi-tier recall)
- Context-type centralized inference (convergent with upstream fix)
- BGE-M3 embedding input truncation
- URI normalization + collision-safe entity writes

Merged on dev-local2 safety branch. Next steps: build + test before
fast-forwarding dev.

Co-Authored-By: claude-flow <ruv@ruv.net>
zeattacker pushed a commit to zeattacker/OpenViking that referenced this pull request Apr 10, 2026
The initial merge of upstream 'Feature/memory opt' (volcengine#1159) auto-merged a
unified operations schema into utils/uri.py and utils/content.py while our
TAKE DEV choice left memory_updater.py / extract_loop.py expecting the
old split schema. Runtime smoke test revealed cascading API mismatches:

  - 'ResolvedOperations' has no 'write_operations' (AttributeError)
  - serialize_with_metadata() arg order mismatch (TypeError on write)
  - LLM output validation would fail on missing reasoning/edit_overview_uris
    fields (upstream commented them out in schema_model_generator)

Two parallel analysis agents (arch map of volcengine#1159 + call-graph audit) both
converged on: TAKE DEV for schema-breaking changes, KEEP upstream for
purely-additive improvements. This commit is the resulting minimal diff.

Reverted to dev (schema-breaking bits):
- utils/uri.py: ResolvedOperations keeps write_operations/edit_operations
  split (load-bearing for brain-hardening _MERGE_ON_COLLISION_TYPES)
- utils/content.py: serialize_with_metadata(content, metadata) positional
  signature matches all 5 call sites (memory_updater x2, memory_type_registry
  x1, content_write x2 — upstream's new content_write also uses this form)
- schema_model_generator.py: uncommented 'reasoning' and 'edit_overview_uris'
  Pydantic field definitions — extract_loop.py:196 requires both

Patched to bridge upstream additive + dev signature:
- memory_type_registry.py::initialize_memory_files — render content_template
  inline with jinja2, then call dev's serialize_with_metadata(rendered,
  metadata) instead of upstream's serialize_with_metadata(metadata,
  content_template=, extract_context=)

Kept upstream wins untouched (already in merged state, fully additive):
- MemoryTypeRegistry.initialize_memory_files() method (volcengine#1159)
- MemoryTypeRegistry.__init__(load_schemas=True) auto-loading
- ExtractContext.get_year/get_month/get_day helpers (used by events.yaml)
- openviking/telemetry/tracer.py module
- compressor_v2 v2_lock_retry config + tracer (volcengine#1275)
- merge_op/base.py get_first_replace() helper
- merge_op/patch.py None-handling branch
- MemoryField.init_value
- soul.yaml / identity.yaml prompt templates
- events.yaml year/month/day folder structure
- AGFS Rust binding (volcengine#1221) — confirmed active at runtime

Smoke test result (conv-26 session_1, qwopus-4b, temp=0.1):
  Written: 3, Edited: 0, Deleted: 0, Errors: 0
  4 memories total (2 entities, 1 episode, 1 other)
  Historical baseline variance range: 4-10 memories, median ~6.
  Result within normal LLM variance.

Co-Authored-By: claude-flow <ruv@ruv.net>
zeattacker pushed a commit to zeattacker/OpenViking that referenced this pull request Apr 10, 2026
Smoke test after the surgical volcengine#1159 integration (8b43ae7) showed a
systematic regression: only entities + episodes extracted (4 memories),
missing events/preferences/profile across 3 deterministic runs.

Root cause (from server log inspection of final_operations JSON):

1. events.yaml — upstream changed filename_template to
     "{{get_year(ranges)}}/{{get_month(ranges)}}/{{get_day(ranges)}}/{{event_name}}.md"
   The get_year/get_month/get_day helpers on ExtractContext derive year/
   month/day from the first message's `created_at` attribute via
   _first_message_time(). The LoCoMo ingest path does not populate
   created_at, so all three helpers return None and the filename renders
   as None/None/None/foo.md — URI resolution rejects it silently.
   LLM emits the event correctly; the template can't render.

2. preferences.yaml — upstream changed filename_template from
     "{{ user }}_{{ topic }}.md"   (flat, proven working in dev)
   to
     "{{ user }}/{{ topic }}.md"   (subdirectory per user)
   Both reference the same `user` + `topic` fields. In practice the
   switch coincides with Qwen-4B emitting `"preferences": []` in the
   extraction output — possibly because the subdir form in the rendered
   schema prompt confuses the small model, possibly incidental. Either
   way dev's form is proven in production, upstream's is not.

Decision: revert both filename templates to dev's proven form. Keep
upstream's additive "Record content that mentions time" rule and the
shorter example text in events.yaml — those don't touch rendering.

Smoke test after fix (3 deterministic runs, qwopus-4b, temp=0.1):
  7 memories total
  entities   2
  episodes   1
  events     1
  preferences 1
  profile.md 1

vs baseline (reverted_smoke 2026-04-09): 6 memories, same 5 categories.
+1 over baseline, 3/3 runs identical.

Co-Authored-By: claude-flow <ruv@ruv.net>
zeattacker pushed a commit to zeattacker/OpenViking that referenced this pull request Apr 10, 2026
…mples

The post-merge entities.yaml prompt I wrote had two related bugs surfaced
during the 19-session LoCoMo bench:

  GET viking://user/.../memories/entities/entities/people/melanie.md → 404
  GET viking://user/.../memories/entities/entities/pets/oscar.md     → 404
  GET viking://user/.../memories/entities/events/2023/06/02/x.md     → 404

Root cause: entity files live at entities/<category>/<name>.md (per the
filename_template '{{ category }}/{{ name }}.md' adopted from upstream
volcengine#1159), but my prompt examples used `../entities/<category>/<name>.md`
for entity-to-entity links. From inside entities/people/caroline.md,
`..` already exits to entities/, so the link resolved to
entities/entities/people/melanie.md — doubled prefix.

Same root cause for entity-to-event links: I had `../events/<year>/<month>
/<day>/<event_name>.md` which (a) only hops one level instead of two
(needs out of <category>/ AND out of entities/) and (b) used the date-
hierarchy filename format that we explicitly reverted in commit 818f083.

Fix:

- Same-category sibling: `<other_name>.md`            (no `..` needed)
- Different category:    `../<other_category>/<name>.md`   (1 level up)
- Event reference:       `../../events/<YYYY-MM-DD>_<event_name>.md`
                         (2 levels up, flat events filename)

Added an explicit "Entity files live at entities/<category>/<name>.md.
Compute relative paths from THAT location" rule to anchor the LLM's
mental model.

This fix only affects new extractions — existing entity files in
production memories will still have the broken links until rewritten.

Co-Authored-By: claude-flow <ruv@ruv.net>
Ferry-200 added a commit to Ferry-200/OpenViking that referenced this pull request Apr 11, 2026
* feat(encryption): add encrypt unit test  for plaintext shorter than the magic header (volcengine#1217)

* fix: PID lock recycle, recall threshold bypass, orphaned compressor refs (volcengine#1211)

* fix: PID lock recycle, recall threshold bypass, orphaned compressor refs

1. process_lock: verify PID is actually OpenViking on Linux by checking
   /proc/{pid}/cmdline. Prevents false DataDirectoryLocked when PIDs are
   recycled to unrelated processes after crash (Fixes volcengine#1088).

2. memory-ranking: add scoreThreshold param to pickMemoriesForInjection
   and filter non-leaf items below threshold. Previously low-scoring
   memories bypassed recallScoreThreshold when supplementing leaves
   (Fixes volcengine#1106).

3. compressor: catch FileNotFoundError separately in _merge_into_existing,
   clean up orphaned vector records so they are not retried indefinitely
   (Fixes volcengine#1048).

* style: ruff format process_lock.py

---------

Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>

* fix(queuefs): dedupe memory semantic parent enqueues within window (volcengine#769) (volcengine#792)

Repeated memory writes enqueue the same parent directory for .overview/.abstract
regeneration, causing redundant VLM work. Skip duplicate enqueues for the same
(account, user, agent, uri) within 45s; resource/session semantic paths unchanged.

Fixes volcengine#769

Made-with: Cursor

* docs: add Claude Code Memory Plugin example link and Chinese docs (volcengine#1228)

Add README link for Claude Code Memory Plugin example in all language
variants (EN, CN, JA) and add Chinese documentation for the plugin.

* fix: prevent startup hang from blocking VLM call in redo recovery (volcengine#1226)

Move redo recovery to a background task so the server starts without
waiting for potentially slow VLM calls. Add 60s timeout to
extract_long_term_memories to prevent indefinite hangs on individual
redo tasks. Clean up the redo task on stop().

Fixes volcengine#1222

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* fix(cli): handle non-UTF-8 filenames in add-resource (volcengine#1224)

Replace to_string_lossy() with to_str() to preserve valid UTF-8
filenames (Chinese, Japanese, special characters) instead of
silently corrupting them. Non-UTF-8 paths now return a clear
Error::InvalidPath instead of garbled output.

Fixes volcengine#1018

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* test(crypto): add regression tests for decrypting short plaintext files (volcengine#1223)

Add tests covering the fix in PR volcengine#1163 where decrypt() raised
'Ciphertext too short' on plaintext files shorter than 4 bytes.

Tests added:
- test_decrypt_empty_plaintext: raw b'' returns b''
- test_decrypt_short_plaintext_less_than_4_bytes: b'X', b'AB', b'ABC' return as-is
- test_decrypt_magic_prefix_without_full_header: b'OVE1' raises CorruptedCiphertextError

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>

* Implement request-scoped wait for write APIs (volcengine#1212)

fix: request wait telemetry id

fix: register request wait before enqueue

add log

* reorg:  Rewrite agfs to ragfs with rust (volcengine#1221)

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* fix: grep level limit

* fix: grep root

* fix: import error

* fix: rust code optimazation

* fix: CI error

* fix: CI go mod cache

* fix: grep level limit

* fix: CI

---------

Co-authored-by: openviking <openviking@example.com>

* fix: update main when release, and add docker hub push (volcengine#1229)

* fix security: feat(resources): harden HTTP resource ingestion against private-network SSRF (volcengine#1133)

* Harden HTTP resource ingestion against private-network SSRF

* chore(ci): retrigger checks

* style: fix resource service import order

* fix(session): add timeout to _wait_for_previous_archive_done to prevent infinite hang (volcengine#1235)

When Phase 2 of a previous archive crashes after writing messages but
before writing .done or .failed.json, the next archive's memory
extraction enters an infinite polling loop with no exit condition.

Add a 5-minute deadline. On timeout, return False (treated as failure)
so the caller writes .failed.json and the session is no longer stuck.

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: volcengine#1238 and volcengine#1242 and volcengine#1232 (volcengine#1243)

* fix(bot): respect OPENVIKING_CONFIG_FILE even when file doesn't exist

Previously, bot's config path resolution would fallback to
~/.openviking/ov.conf when OPENVIKING_CONFIG_FILE was set but the
file didn't exist. This was inconsistent with server's behavior,
which treats a missing env-specified config as an error.

In container deployments with OPENVIKING_CONFIG_FILE=/app/ov.conf,
this caused bot to potentially write auto-generated config to
/root/.openviking/ov.conf instead of the intended /app/ov.conf,
leading to config file path mismatches.

Now bot respects the environment variable unconditionally, matching
server's behavior and ensuring both components use the same config
path.

Fixes volcengine#1242

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(embedder): support dimension truncation for OpenAI-compatible models

Previously, when users configured a dimension (e.g., 1024) for OpenAI-compatible
embedding models that don't support the 'dimensions' API parameter, the system
would fail with "dimensions is currently not supported" error.

Additionally, when dimension was not configured, the config layer would return
a hardcoded fallback of 2048, but the actual model might return a different
dimension (e.g., 1024), causing dimension validation failures.

This fix implements vector truncation in OpenAIDenseEmbedder:
- Removes the 'dimensions' parameter from API calls (not supported by all models)
- If user configures dimension=1024 and model returns 2048, truncates to 1024
- If no dimension is configured, uses model's native dimension without truncation
- Applies truncation to both single and batch embedding operations

This allows users to:
1. Use OpenAI-compatible models with custom dimensions via truncation
2. Control vector dimensions for storage optimization
3. Avoid dimension mismatch errors between config and actual embeddings

Fixes volcengine#1238

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: volcengine#1232

---------

Co-authored-by: openviking <openviking@example.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Feature/memory opt (volcengine#1159)

* fix(plugin): add skills to autoRecall search scope (volcengine#1225)

Include viking://agent/skills in the autoRecall search alongside
user memories and agent memories. Skills stored in OpenViking are
now auto-injected into context when relevant to the query.

Fixes volcengine#1089

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* Revert "fix(session): add timeout to _wait_for_previous_archive_done to preve…" (volcengine#1265)

This reverts commit dc15daf.

* channel mention (volcengine#1272)

* feat(storage):  volcengine vector db support sts token  (volcengine#1268)

* feat(storage):  volcengine vector db support sts token  https://www.volcengine.com/docs/7139/1302258?lang=zh

* feat(storage):  volcengine vector db support sts token  https://www.volcengine.com/docs/7139/1302258?lang=zh

* feat(server): support host all to use dual stack netstat (volcengine#1273)

* feat(auth): Restrict trusted mode without API key to localhost (volcengine#1279)

* Improve memory v2 lock retry controls in compressor (volcengine#1275)

* fix(security): configurable embedding circuit breaker & log suppression (volcengine#1277)

* update wechat group qrcode (volcengine#1282)

replace the old one.

* ci: optimize API test matrix from 5 to 3 channels (volcengine#1281)

- Reduce OS matrix from 5 channels to 3 channels
- Use ubuntu-latest, macos-latest, windows-latest instead of specific versions
- Remove redundant ubuntu-arm and intel macos variants

* feat: add MiniMax-M2.7 and MiniMax-M2.7-highspeed provider support (volcengine#1284)

- Update provider registry to document MiniMax-M2.7 and MiniMax-M2.7-highspeed
  as the recommended models (replacing the outdated M2.1 example comment)
- Add explicit note that MiniMax does not support system messages (they are
  merged into the first user message automatically)
- Update README to advertise MiniMax-M2.7 and MiniMax-M2.7-highspeed as the
  recommended MiniMax models with configuration instructions
- Add comprehensive unit tests (17 tests) covering:
  - Registry keyword matching for MiniMax-M2.7 and MiniMax-M2.7-highspeed
  - Model prefix resolution (minimax/MiniMax-M2.7)
  - System message merging for both LiteLLMProvider and OpenAICompatibleProvider
  - Edge cases: multiple system messages, no system messages, non-MiniMax models
  - MINIMAX_API_KEY environment variable and international API base URL

Co-authored-by: octo-patch <octo-patch@github.com>

* feat(eval): add openclaw eval sh (volcengine#1287)

* 增加完整的一键评测脚本

* 增加完整的一键评测脚本

* add create time in add_message (volcengine#1288)

* fix(lark): add lark-oapi (volcengine#1285)

* docs: add prompt guides in zh and en (volcengine#1292)

* benchmark: add LoCoMo evaluation scripts for mem0 (volcengine#1290)

Implements a two-phase benchmark pipeline for evaluating mem0 on the
LoCoMo long-term conversation dataset (10 samples, 1540 non-adversarial QA pairs).

- ingest.py: imports LoCoMo conversation sessions into mem0, using
  sample_id as the userId namespace. All messages use "user" role with
  [SpeakerName]: prefix to preserve two-person dialogue structure.
  Temporal context is added via a [System] prefix on each session.

- eval.py: sends QA questions to an OpenClaw agent backed by the
  openclaw-mem0 plugin. Restarts the gateway per sample to switch the
  active userId, verifies the correct user is loaded before running
  questions, then parallelizes questions within each sample using unique
  session keys. Parses session jsonl to collect accurate per-turn token
  usage. Optionally judges answers with a Volcengine ARK LLM.

- delete_user.py: utility to clear mem0 memories for given user_ids.

- README.md: documents prerequisites, ingest/eval parameters, output
  format, and per-sample run commands.

* fix(docker): restore venv tooling for ragfs build (volcengine#1295)

fix(docker): preserve ragfs wheel extraction script indentation

fix(docker): keep heredoc cleanup inside run shell

fix(docker): terminate ragfs extraction heredoc cleanly

fix(ci): split docker manifest digests by registry

* Include gemini optional dependency in Docker image (volcengine#1254)

The Dockerfile only includes the `bot` extra when installing dependencies,
which means the `google-genai` package is missing at runtime. This causes
the server to crash with `TypeError: 'NoneType' object is not callable`
when users configure the Gemini embedding provider.

Add `--extra gemini` to the `uv sync` commands so the Docker image ships
with Gemini support out of the box.

Fixes volcengine#1253

* ci: add timeout and SMTP failure notification (volcengine#1293)

- Add 50 minutes timeout for api_test and oc2ov_test workflows
- Add SMTP email notification on workflow failure
- Email will be sent to likaisong@bytedance.com

Required secrets:
- SMTP_USERNAME: SMTP email username
- SMTP_PASSWORD: SMTP email password/app password

* fix(openclaw): sanitize and cap recall queries (volcengine#1297)

Recall should use cleaned user text and avoid sending oversized prompts
to retrieval. Add unit coverage for sanitization and truncation behavior.

* fix(ci): repair reusable build workflow yaml blocks (volcengine#1300)

* feat(ast): add Lua parser support and extractor wiring (volcengine#1286)

* fix(ci): remove disallowed notify-failure action (volcengine#1302)

- Remove dawidd6/action-send-mail@v4 which is not in allowed list
- Keep timeout-minutes: 50 configuration
- Use GitHub built-in notifications instead

* fix(embedder): reduce async contention in session flows (volcengine#1301)

Introduce native async embedding paths across providers, switch async
retrieval/session hotspots to use them, and add a standalone mixed-load
benchmark plus before/after benchmark evidence for the regression.

* Feat(ovpack): recursively vectorize all imported docs (volcengine#1294)

* feat(ovpack): recursively enqueue directory vectorization

* feat(ovpack): recursively vectorize all imported docs

* refactor(ovpack): use fixed workers for direct vectorization

* refactor(ovpack): revert direct vectorization to gather

* chore: drop redundant default tree args

* feat: 巻加测试优化功能 (volcengine#1280)

- Session ID 自动管理
- 智能等待策略
- 重试机制
- 测试数据管理

* fix(eval): OpenClaw eval, import to ov use default user (volcengine#1305)

* 增加完整的一键评测脚本

* 增加完整的一键评测脚本

* 完善评测脚本

* 完善评测脚本

* 完善评测脚本

* fix(memory): batch semantic processing in _process_memory_directory to prevent CPU spikes (volcengine#1245) (volcengine#1304)

* Fix ci (volcengine#1307)

* fix(ci): fix build ci

* build: move ragfs-python packaging into setup.py

* fix bug (volcengine#1317)

* fix: 优化测试关键词匹配和移除 Release Approval Gate (volcengine#1313)

- 添加中英文关键词匹配:删除、无、deleted、expired、no longer
- 移除 workflow 中的 release-approval job

* fix: remove debug print statement in bot health check endpoint (volcengine#1310)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add scenario-based API tests  (volcengine#1303)

* feat: add scenario-based API tests

- Add scenario test framework with proper categorization
- Add tests for resources_retrieval, sessions, and stability_error scenarios
- Add get_task() and wait_for_task() methods to API client for async operations
- Add get_session_context() method for session context retrieval
- Update API test workflow name from '03' to '06'
- All 14 scenario tests pass with proper business logic validation

* fix: skip scenarios tests when no VLM/Embedding secrets

Scenarios tests require VLM for session archival summaries and
Embedding for semantic search. Skip them in basic test mode.

* fix(security): remove leaked token from settings.py (volcengine#1319)

- Remove tests/oc2ov_test/config/settings.py containing exposed auth token
- Add settings.py to .gitignore to prevent future leaks
- Users should copy settings.example.py to settings.py and fill in their own tokens

* fix(resources): implement trailing slash semantics for resource URIs (volcengine#1321)

add support for trailing slash rules in resource URIs to control file/directory placement
update CLI, API, and documentation to reflect new URI handling semantics
add comprehensive tests for all URI semantics cases

* Revert "fix(resources): implement trailing slash semantics for resource URIs …" (volcengine#1322)

This reverts commit dec57bd.

* fix litellm embedding dimension issues (volcengine#1323)

Co-authored-by: openviking <openviking@example.com>

* ci: optimize runner usage with conditional OS matrix and parallel limit (volcengine#1327)

- Only run full OS matrix (ubuntu-24.04, macos-14, windows-latest) on main branch pushes
- PR branches use ubuntu-24.04 only to reduce runner wait time
- Add max-parallel: 2 to limit concurrent job execution

* fix(bot):Response language, Multi user memory commit (volcengine#1329)

* 修复语种问题

* 多user提交ov

* ci: remove lite and full test workflows (volcengine#1331)

* docs: fix docker deployment (volcengine#1332)

Co-authored-by: openviking <openviking@example.com>

* docs(openclaw-plugin): add health check tools guide (volcengine#1326)

Add solution for health check tools report http 404 error

* fix(queue): expose re-enqueue counts in queue status (volcengine#1337)

Track semantic and embedding re-enqueues as first-class queue metrics so
observer output, wait_processed payloads, and telemetry summaries make
retry loops visible before they escalate into hard errors.

* feat(s3fs): add disable_batch_delete option for OSS compatibility (volcengine#1330) (volcengine#1333)

Co-authored-by: yuanqianhe <yuanqianhe@lattebank.com>

* Fix/add resource cover (volcengine#1338)

* fix(resources): improve handling of resource imports and naming

- Add source_name to file upload requests for preserving original filenames
- Handle single-directory zip files by using their root directory directly
- Support viking://resources as parent directory for imports
- Split summarization for resources root imports into individual child items
- Add tests for new resource import behaviors

* style(tests): format test files with consistent line breaks

Improve readability by applying consistent line breaks in test file patches and removing trailing whitespace

* afterTurn: store messages with actual roles and skip heartbeat messages (volcengine#1340)

* fix: fall back to prefix filters for volcengine path scope (volcengine#1342)

Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>

* fix(session): auto-create missing sessions on first add (volcengine#1348)

Ensure the add-message API materializes a missing session before loading it so
plugins can append the first turn without an explicit create_session call.

* Fix/api test issues (volcengine#1341)

* fix: make api_test more robust for CI environments

- Add @pytest.hookimpl(optionalhook=True) for pytest-html hooks to fix compatibility issues
- test_fs_read: skip test when AGFS service is not available
- test_get_overview: skip test when overview file does not exist

These changes ensure tests pass gracefully on CI servers where AGFS service
may not be available or files may not exist.

* ci: reduce max-parallel to 1 for better resource availability

Reduce max-parallel from 2 to 1 to avoid waiting for multiple runners
when GitHub-hosted runners are limited.

* fix: derive context_type from URI in index_resource (volcengine#1346)

index_resource() always passed the default context_type="resource" to
vectorize_directory_meta() and vectorize_file(), even when indexing
memory directories (URIs containing /memories/).  This caused all
records created via the /api/v1/content/reindex endpoint to be tagged
as "resource" instead of "memory", breaking stats aggregation
(which filters on context_type="memory") and search scoping.

Use the existing get_context_type_for_uri() helper to derive the
correct context_type from the URI and pass it through to both
vectorize_directory_meta() and vectorize_file().

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* reorg: remove golang depends (volcengine#1339)

* docs: fix docker deployment

* reorg: remove third_party/agfs

* feat(s3fs): add disable_batch_delete option for OSS compatibility

Port of PR volcengine#1333 from Go version to Rust:

- Add disable_batch_delete config option to S3Client
- When enabled, use sequential single-object deletes instead of DeleteObjects
- This is for S3-compatible services like Alibaba Cloud OSS that require
  Content-MD5 for DeleteObjects but AWS SDK v2 does not send it by default
- Add documentation and config example for OSS

* fix(s3fs): pass disable_batch_delete config from Python to Rust

Add disable_batch_delete to the s3_plugin_config dict in _generate_plugin_config
so that the Python config can properly control the Rust S3FS plugin's behavior.

* reorg: remove third_party/agfs

* reorg: remove third_party/agfs

* change some docs

* change some docs

---------

Co-authored-by: openviking <openviking@example.com>

* Feat/mem opt (volcengine#1349)

* fix(memory): handle string response from VLM when tools disabled

- Fix AttributeError when VLM returns string instead of VLMResponse
- Fix tuple creation bug with trailing comma causing double-nested tools array

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update

* chore: replace LGBTQ example with book club in entities.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(memory): disable tools on extended iteration to prevent infinite loop

When max_iterations is extended due to tool calls, disable tools for the
additional iteration to ensure the extract loop terminates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(memory): handle out-of-bounds range from LLM extraction

Clamp range values to valid message indices instead of skipping,
to handle cases where LLM extracts incorrect ranges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: openai like embedding models fix, no more matryoshka error (volcengine#1350)

Co-authored-by: openviking <openviking@example.com>

* 增加关闭ov的配置 (volcengine#1352)

* feat: 新前端项目初始化

* style: 切换到vega风格

* feat: 新增定制化的 openapi codegen

* chore: 把openapi生成的ov-client移到src/gen底下

* feat: 生成 openviking-server 的 client

* feat: 搭建 openviking client 的适配层

* docs: 新增 ov-client 适配层描述

* chore: 清理项目模板

* clean: 清理模板样式

* deps: 新增 tanstack query 依赖

* style: 调整 shadcn 风格

* feat: 导入基础的shadcn组件

* feat: 复刻旧的 webconsole

* fix: 修复legacy代码commit不完整的问题

* docs: readme

* feat: 允许不显示传递自定义client

* dev: add development environment script

* feat: support tags for resource management and retrieval

This commit introduces a native `tags` parameter across the entire stack (Core, API, SDK, CLI) to
easily tag resources and filter them during semantic search.

Changes include:
   - **Core & Storage**:
    - Write `tags` to the resource root's `.meta.json` during `add_resource`.
    - Read tags from `.meta.json` during async semantic processing and hoist them to the VectorDB context for indexing.
    - Enrich directory stats/entries in `VikingFS` (`ls`, `stat`) with `tags`.
   - **API & Service**: Add `tags` field to resource creation and search routes.
   - **Python SDK**:
    - Add `tags` parameter to `add_resource`.
    - Add `tags` shortcut parameter to `find` and `search` methods, which automatically constructs the underlying `contains` metadata filters.
   - **Rust CLI**: Add `--tags` flag to `ov add-resource`, `ov find`, and `ov search` commands.
   - **Docs**: Update English and Chinese documentation for Resources, Retrieval, and Filesystem APIs to reflect the new `tags` parameters and structures.
   - **Tests**: Add unit tests for resource processor meta merging, VikingFS tag reading, and HTTP client tag filtering logic.

* feat(search): support tags filtering and return tags in retrieval results

* refactor(tags): extract build_tags_filter helper and improve validation

* chore(scripts): add fast mode toggle to bootstrap menu

* fix(tags): sanitize once and isolate semantic tags context

* feat: 三段式布局 + 功能页拆分

- 新增顶栏(全宽) + 左侧边栏 + 右侧内容区的三段式布局
- 将 Data 大页面拆分为独立路由: FileSystem、Find、Add Memory
- 将 Access 页面迁移为独立的 Settings 页面
- 侧边栏按 Data/Ops/Access 分组显示导航项
- 提取共享工具函数到 data-utils.ts
- 修复 .gitignore 中 data/ 规则误匹配子目录的问题

* feat(web-studio): add i18n support and dark/light theme toggle

- Add i18next with browser language detection (zh-CN / en)
- Add language switcher dropdown in header bar
- Add dark/light theme toggle with animated Sun/Moon icons
- Wire up next-themes ThemeProvider with class-based dark mode
- Replace shadcn dark theme with default Zinc (neutral gray)
- Connect sidebar labels to i18n translation keys
- Fix dropdown menu forced dark styling

---------

Co-authored-by: baojun-zhang <zhangbaojun.1@bytedance.com>
Co-authored-by: Jason <101583541+JasonOA888@users.noreply.github.com>
Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
Co-authored-by: Protocol Zero <257158451+Protocol-zero-0@users.noreply.github.com>
Co-authored-by: 灿烂甜菜 <731426007@qq.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: yc111233 <109650216+yc111233@users.noreply.github.com>
Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Jiahui Zhou <zhoujiahui.01@bytedance.com>
Co-authored-by: MaojiaSheng <shengmaojia@bytedance.com>
Co-authored-by: openviking <openviking@example.com>
Co-authored-by: 13ernkastel <LennonCMJ@live.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: chenjw <chenjunwen@bytedance.com>
Co-authored-by: yeshion23333 <dutao.1786@bytedance.com>
Co-authored-by: heaoxiang-ai <heaoxiang@bytedance.com>
Co-authored-by: Yaoyao <yuyao.yoyo@bytedance.com>
Co-authored-by: kaisongli <likaisong@bytedance.com>
Co-authored-by: Octopus <liyuan851277048@icloud.com>
Co-authored-by: octo-patch <octo-patch@github.com>
Co-authored-by: AutoCoder <wulf234@163.com>
Co-authored-by: yangxinxin-7 <yangxinxin.24@bytedance.com>
Co-authored-by: Yang Zhi <yangzhi.see@gmail.com>
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
Co-authored-by: Shawn-o <64448366+Shawn-cf-o@users.noreply.github.com>
Co-authored-by: zgy <1670519171@qq.com>
Co-authored-by: chuanbao666 <sunchuanbao@bytedance.com>
Co-authored-by: 7. Sun <jhao.sun@gmail.com>
Co-authored-by: yepper <yangshunyao@bytedance.com>
Co-authored-by: mrj666 <33885009+mrj666@users.noreply.github.com>
Co-authored-by: yuan7he <yuan7he@gmail.com>
Co-authored-by: yuanqianhe <yuanqianhe@lattebank.com>
Co-authored-by: Sense_wang <167664334+haosenwang1018@users.noreply.github.com>
Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
Co-authored-by: ifeichuan <feichuan05@gmail.com>
Co-authored-by: Jye10032 <736891807@qq.com>
Ferry-200 added a commit to Ferry-200/OpenViking that referenced this pull request Apr 11, 2026
* feat(encryption): add encrypt unit test  for plaintext shorter than the magic header (volcengine#1217)

* fix: PID lock recycle, recall threshold bypass, orphaned compressor refs (volcengine#1211)

* fix: PID lock recycle, recall threshold bypass, orphaned compressor refs

1. process_lock: verify PID is actually OpenViking on Linux by checking
   /proc/{pid}/cmdline. Prevents false DataDirectoryLocked when PIDs are
   recycled to unrelated processes after crash (Fixes volcengine#1088).

2. memory-ranking: add scoreThreshold param to pickMemoriesForInjection
   and filter non-leaf items below threshold. Previously low-scoring
   memories bypassed recallScoreThreshold when supplementing leaves
   (Fixes volcengine#1106).

3. compressor: catch FileNotFoundError separately in _merge_into_existing,
   clean up orphaned vector records so they are not retried indefinitely
   (Fixes volcengine#1048).

* style: ruff format process_lock.py

---------

Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>

* fix(queuefs): dedupe memory semantic parent enqueues within window (volcengine#769) (volcengine#792)

Repeated memory writes enqueue the same parent directory for .overview/.abstract
regeneration, causing redundant VLM work. Skip duplicate enqueues for the same
(account, user, agent, uri) within 45s; resource/session semantic paths unchanged.

Fixes volcengine#769

Made-with: Cursor

* docs: add Claude Code Memory Plugin example link and Chinese docs (volcengine#1228)

Add README link for Claude Code Memory Plugin example in all language
variants (EN, CN, JA) and add Chinese documentation for the plugin.

* fix: prevent startup hang from blocking VLM call in redo recovery (volcengine#1226)

Move redo recovery to a background task so the server starts without
waiting for potentially slow VLM calls. Add 60s timeout to
extract_long_term_memories to prevent indefinite hangs on individual
redo tasks. Clean up the redo task on stop().

Fixes volcengine#1222

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* fix(cli): handle non-UTF-8 filenames in add-resource (volcengine#1224)

Replace to_string_lossy() with to_str() to preserve valid UTF-8
filenames (Chinese, Japanese, special characters) instead of
silently corrupting them. Non-UTF-8 paths now return a clear
Error::InvalidPath instead of garbled output.

Fixes volcengine#1018

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* test(crypto): add regression tests for decrypting short plaintext files (volcengine#1223)

Add tests covering the fix in PR volcengine#1163 where decrypt() raised
'Ciphertext too short' on plaintext files shorter than 4 bytes.

Tests added:
- test_decrypt_empty_plaintext: raw b'' returns b''
- test_decrypt_short_plaintext_less_than_4_bytes: b'X', b'AB', b'ABC' return as-is
- test_decrypt_magic_prefix_without_full_header: b'OVE1' raises CorruptedCiphertextError

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>

* Implement request-scoped wait for write APIs (volcengine#1212)

fix: request wait telemetry id

fix: register request wait before enqueue

add log

* reorg:  Rewrite agfs to ragfs with rust (volcengine#1221)

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* reorg: rewrite agfs with rust, and named with ragfs, keep License

* fix: grep level limit

* fix: grep root

* fix: import error

* fix: rust code optimazation

* fix: CI error

* fix: CI go mod cache

* fix: grep level limit

* fix: CI

---------

Co-authored-by: openviking <openviking@example.com>

* fix: update main when release, and add docker hub push (volcengine#1229)

* fix security: feat(resources): harden HTTP resource ingestion against private-network SSRF (volcengine#1133)

* Harden HTTP resource ingestion against private-network SSRF

* chore(ci): retrigger checks

* style: fix resource service import order

* fix(session): add timeout to _wait_for_previous_archive_done to prevent infinite hang (volcengine#1235)

When Phase 2 of a previous archive crashes after writing messages but
before writing .done or .failed.json, the next archive's memory
extraction enters an infinite polling loop with no exit condition.

Add a 5-minute deadline. On timeout, return False (treated as failure)
so the caller writes .failed.json and the session is no longer stuck.

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: volcengine#1238 and volcengine#1242 and volcengine#1232 (volcengine#1243)

* fix(bot): respect OPENVIKING_CONFIG_FILE even when file doesn't exist

Previously, bot's config path resolution would fallback to
~/.openviking/ov.conf when OPENVIKING_CONFIG_FILE was set but the
file didn't exist. This was inconsistent with server's behavior,
which treats a missing env-specified config as an error.

In container deployments with OPENVIKING_CONFIG_FILE=/app/ov.conf,
this caused bot to potentially write auto-generated config to
/root/.openviking/ov.conf instead of the intended /app/ov.conf,
leading to config file path mismatches.

Now bot respects the environment variable unconditionally, matching
server's behavior and ensuring both components use the same config
path.

Fixes volcengine#1242

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(embedder): support dimension truncation for OpenAI-compatible models

Previously, when users configured a dimension (e.g., 1024) for OpenAI-compatible
embedding models that don't support the 'dimensions' API parameter, the system
would fail with "dimensions is currently not supported" error.

Additionally, when dimension was not configured, the config layer would return
a hardcoded fallback of 2048, but the actual model might return a different
dimension (e.g., 1024), causing dimension validation failures.

This fix implements vector truncation in OpenAIDenseEmbedder:
- Removes the 'dimensions' parameter from API calls (not supported by all models)
- If user configures dimension=1024 and model returns 2048, truncates to 1024
- If no dimension is configured, uses model's native dimension without truncation
- Applies truncation to both single and batch embedding operations

This allows users to:
1. Use OpenAI-compatible models with custom dimensions via truncation
2. Control vector dimensions for storage optimization
3. Avoid dimension mismatch errors between config and actual embeddings

Fixes volcengine#1238

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: volcengine#1232

---------

Co-authored-by: openviking <openviking@example.com>
Co-authored-by: Claude <noreply@anthropic.com>

* Feature/memory opt (volcengine#1159)

* fix(plugin): add skills to autoRecall search scope (volcengine#1225)

Include viking://agent/skills in the autoRecall search alongside
user memories and agent memories. Skills stored in OpenViking are
now auto-injected into context when relevant to the query.

Fixes volcengine#1089

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* Revert "fix(session): add timeout to _wait_for_previous_archive_done to preve…" (volcengine#1265)

This reverts commit dc15daf.

* channel mention (volcengine#1272)

* feat(storage):  volcengine vector db support sts token  (volcengine#1268)

* feat(storage):  volcengine vector db support sts token  https://www.volcengine.com/docs/7139/1302258?lang=zh

* feat(storage):  volcengine vector db support sts token  https://www.volcengine.com/docs/7139/1302258?lang=zh

* feat(server): support host all to use dual stack netstat (volcengine#1273)

* feat(auth): Restrict trusted mode without API key to localhost (volcengine#1279)

* Improve memory v2 lock retry controls in compressor (volcengine#1275)

* fix(security): configurable embedding circuit breaker & log suppression (volcengine#1277)

* update wechat group qrcode (volcengine#1282)

replace the old one.

* ci: optimize API test matrix from 5 to 3 channels (volcengine#1281)

- Reduce OS matrix from 5 channels to 3 channels
- Use ubuntu-latest, macos-latest, windows-latest instead of specific versions
- Remove redundant ubuntu-arm and intel macos variants

* feat: add MiniMax-M2.7 and MiniMax-M2.7-highspeed provider support (volcengine#1284)

- Update provider registry to document MiniMax-M2.7 and MiniMax-M2.7-highspeed
  as the recommended models (replacing the outdated M2.1 example comment)
- Add explicit note that MiniMax does not support system messages (they are
  merged into the first user message automatically)
- Update README to advertise MiniMax-M2.7 and MiniMax-M2.7-highspeed as the
  recommended MiniMax models with configuration instructions
- Add comprehensive unit tests (17 tests) covering:
  - Registry keyword matching for MiniMax-M2.7 and MiniMax-M2.7-highspeed
  - Model prefix resolution (minimax/MiniMax-M2.7)
  - System message merging for both LiteLLMProvider and OpenAICompatibleProvider
  - Edge cases: multiple system messages, no system messages, non-MiniMax models
  - MINIMAX_API_KEY environment variable and international API base URL

Co-authored-by: octo-patch <octo-patch@github.com>

* feat(eval): add openclaw eval sh (volcengine#1287)

* 增加完整的一键评测脚本

* 增加完整的一键评测脚本

* add create time in add_message (volcengine#1288)

* fix(lark): add lark-oapi (volcengine#1285)

* docs: add prompt guides in zh and en (volcengine#1292)

* benchmark: add LoCoMo evaluation scripts for mem0 (volcengine#1290)

Implements a two-phase benchmark pipeline for evaluating mem0 on the
LoCoMo long-term conversation dataset (10 samples, 1540 non-adversarial QA pairs).

- ingest.py: imports LoCoMo conversation sessions into mem0, using
  sample_id as the userId namespace. All messages use "user" role with
  [SpeakerName]: prefix to preserve two-person dialogue structure.
  Temporal context is added via a [System] prefix on each session.

- eval.py: sends QA questions to an OpenClaw agent backed by the
  openclaw-mem0 plugin. Restarts the gateway per sample to switch the
  active userId, verifies the correct user is loaded before running
  questions, then parallelizes questions within each sample using unique
  session keys. Parses session jsonl to collect accurate per-turn token
  usage. Optionally judges answers with a Volcengine ARK LLM.

- delete_user.py: utility to clear mem0 memories for given user_ids.

- README.md: documents prerequisites, ingest/eval parameters, output
  format, and per-sample run commands.

* fix(docker): restore venv tooling for ragfs build (volcengine#1295)

fix(docker): preserve ragfs wheel extraction script indentation

fix(docker): keep heredoc cleanup inside run shell

fix(docker): terminate ragfs extraction heredoc cleanly

fix(ci): split docker manifest digests by registry

* Include gemini optional dependency in Docker image (volcengine#1254)

The Dockerfile only includes the `bot` extra when installing dependencies,
which means the `google-genai` package is missing at runtime. This causes
the server to crash with `TypeError: 'NoneType' object is not callable`
when users configure the Gemini embedding provider.

Add `--extra gemini` to the `uv sync` commands so the Docker image ships
with Gemini support out of the box.

Fixes volcengine#1253

* ci: add timeout and SMTP failure notification (volcengine#1293)

- Add 50 minutes timeout for api_test and oc2ov_test workflows
- Add SMTP email notification on workflow failure
- Email will be sent to likaisong@bytedance.com

Required secrets:
- SMTP_USERNAME: SMTP email username
- SMTP_PASSWORD: SMTP email password/app password

* fix(openclaw): sanitize and cap recall queries (volcengine#1297)

Recall should use cleaned user text and avoid sending oversized prompts
to retrieval. Add unit coverage for sanitization and truncation behavior.

* fix(ci): repair reusable build workflow yaml blocks (volcengine#1300)

* feat(ast): add Lua parser support and extractor wiring (volcengine#1286)

* fix(ci): remove disallowed notify-failure action (volcengine#1302)

- Remove dawidd6/action-send-mail@v4 which is not in allowed list
- Keep timeout-minutes: 50 configuration
- Use GitHub built-in notifications instead

* fix(embedder): reduce async contention in session flows (volcengine#1301)

Introduce native async embedding paths across providers, switch async
retrieval/session hotspots to use them, and add a standalone mixed-load
benchmark plus before/after benchmark evidence for the regression.

* Feat(ovpack): recursively vectorize all imported docs (volcengine#1294)

* feat(ovpack): recursively enqueue directory vectorization

* feat(ovpack): recursively vectorize all imported docs

* refactor(ovpack): use fixed workers for direct vectorization

* refactor(ovpack): revert direct vectorization to gather

* chore: drop redundant default tree args

* feat: 巻加测试优化功能 (volcengine#1280)

- Session ID 自动管理
- 智能等待策略
- 重试机制
- 测试数据管理

* fix(eval): OpenClaw eval, import to ov use default user (volcengine#1305)

* 增加完整的一键评测脚本

* 增加完整的一键评测脚本

* 完善评测脚本

* 完善评测脚本

* 完善评测脚本

* fix(memory): batch semantic processing in _process_memory_directory to prevent CPU spikes (volcengine#1245) (volcengine#1304)

* Fix ci (volcengine#1307)

* fix(ci): fix build ci

* build: move ragfs-python packaging into setup.py

* fix bug (volcengine#1317)

* fix: 优化测试关键词匹配和移除 Release Approval Gate (volcengine#1313)

- 添加中英文关键词匹配:删除、无、deleted、expired、no longer
- 移除 workflow 中的 release-approval job

* fix: remove debug print statement in bot health check endpoint (volcengine#1310)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add scenario-based API tests  (volcengine#1303)

* feat: add scenario-based API tests

- Add scenario test framework with proper categorization
- Add tests for resources_retrieval, sessions, and stability_error scenarios
- Add get_task() and wait_for_task() methods to API client for async operations
- Add get_session_context() method for session context retrieval
- Update API test workflow name from '03' to '06'
- All 14 scenario tests pass with proper business logic validation

* fix: skip scenarios tests when no VLM/Embedding secrets

Scenarios tests require VLM for session archival summaries and
Embedding for semantic search. Skip them in basic test mode.

* fix(security): remove leaked token from settings.py (volcengine#1319)

- Remove tests/oc2ov_test/config/settings.py containing exposed auth token
- Add settings.py to .gitignore to prevent future leaks
- Users should copy settings.example.py to settings.py and fill in their own tokens

* fix(resources): implement trailing slash semantics for resource URIs (volcengine#1321)

add support for trailing slash rules in resource URIs to control file/directory placement
update CLI, API, and documentation to reflect new URI handling semantics
add comprehensive tests for all URI semantics cases

* Revert "fix(resources): implement trailing slash semantics for resource URIs …" (volcengine#1322)

This reverts commit dec57bd.

* fix litellm embedding dimension issues (volcengine#1323)

Co-authored-by: openviking <openviking@example.com>

* ci: optimize runner usage with conditional OS matrix and parallel limit (volcengine#1327)

- Only run full OS matrix (ubuntu-24.04, macos-14, windows-latest) on main branch pushes
- PR branches use ubuntu-24.04 only to reduce runner wait time
- Add max-parallel: 2 to limit concurrent job execution

* fix(bot):Response language, Multi user memory commit (volcengine#1329)

* 修复语种问题

* 多user提交ov

* ci: remove lite and full test workflows (volcengine#1331)

* docs: fix docker deployment (volcengine#1332)

Co-authored-by: openviking <openviking@example.com>

* docs(openclaw-plugin): add health check tools guide (volcengine#1326)

Add solution for health check tools report http 404 error

* fix(queue): expose re-enqueue counts in queue status (volcengine#1337)

Track semantic and embedding re-enqueues as first-class queue metrics so
observer output, wait_processed payloads, and telemetry summaries make
retry loops visible before they escalate into hard errors.

* feat(s3fs): add disable_batch_delete option for OSS compatibility (volcengine#1330) (volcengine#1333)

Co-authored-by: yuanqianhe <yuanqianhe@lattebank.com>

* Fix/add resource cover (volcengine#1338)

* fix(resources): improve handling of resource imports and naming

- Add source_name to file upload requests for preserving original filenames
- Handle single-directory zip files by using their root directory directly
- Support viking://resources as parent directory for imports
- Split summarization for resources root imports into individual child items
- Add tests for new resource import behaviors

* style(tests): format test files with consistent line breaks

Improve readability by applying consistent line breaks in test file patches and removing trailing whitespace

* afterTurn: store messages with actual roles and skip heartbeat messages (volcengine#1340)

* fix: fall back to prefix filters for volcengine path scope (volcengine#1342)

Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>

* fix(session): auto-create missing sessions on first add (volcengine#1348)

Ensure the add-message API materializes a missing session before loading it so
plugins can append the first turn without an explicit create_session call.

* Fix/api test issues (volcengine#1341)

* fix: make api_test more robust for CI environments

- Add @pytest.hookimpl(optionalhook=True) for pytest-html hooks to fix compatibility issues
- test_fs_read: skip test when AGFS service is not available
- test_get_overview: skip test when overview file does not exist

These changes ensure tests pass gracefully on CI servers where AGFS service
may not be available or files may not exist.

* ci: reduce max-parallel to 1 for better resource availability

Reduce max-parallel from 2 to 1 to avoid waiting for multiple runners
when GitHub-hosted runners are limited.

* fix: derive context_type from URI in index_resource (volcengine#1346)

index_resource() always passed the default context_type="resource" to
vectorize_directory_meta() and vectorize_file(), even when indexing
memory directories (URIs containing /memories/).  This caused all
records created via the /api/v1/content/reindex endpoint to be tagged
as "resource" instead of "memory", breaking stats aggregation
(which filters on context_type="memory") and search scoping.

Use the existing get_context_type_for_uri() helper to derive the
correct context_type from the URI and pass it through to both
vectorize_directory_meta() and vectorize_file().

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* reorg: remove golang depends (volcengine#1339)

* docs: fix docker deployment

* reorg: remove third_party/agfs

* feat(s3fs): add disable_batch_delete option for OSS compatibility

Port of PR volcengine#1333 from Go version to Rust:

- Add disable_batch_delete config option to S3Client
- When enabled, use sequential single-object deletes instead of DeleteObjects
- This is for S3-compatible services like Alibaba Cloud OSS that require
  Content-MD5 for DeleteObjects but AWS SDK v2 does not send it by default
- Add documentation and config example for OSS

* fix(s3fs): pass disable_batch_delete config from Python to Rust

Add disable_batch_delete to the s3_plugin_config dict in _generate_plugin_config
so that the Python config can properly control the Rust S3FS plugin's behavior.

* reorg: remove third_party/agfs

* reorg: remove third_party/agfs

* change some docs

* change some docs

---------

Co-authored-by: openviking <openviking@example.com>

* Feat/mem opt (volcengine#1349)

* fix(memory): handle string response from VLM when tools disabled

- Fix AttributeError when VLM returns string instead of VLMResponse
- Fix tuple creation bug with trailing comma causing double-nested tools array

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update

* chore: replace LGBTQ example with book club in entities.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(memory): disable tools on extended iteration to prevent infinite loop

When max_iterations is extended due to tool calls, disable tools for the
additional iteration to ensure the extract loop terminates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(memory): handle out-of-bounds range from LLM extraction

Clamp range values to valid message indices instead of skipping,
to handle cases where LLM extracts incorrect ranges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: openai like embedding models fix, no more matryoshka error (volcengine#1350)

Co-authored-by: openviking <openviking@example.com>

* 增加关闭ov的配置 (volcengine#1352)

* feat: 新前端项目初始化

* style: 切换到vega风格

* feat: 新增定制化的 openapi codegen

* chore: 把openapi生成的ov-client移到src/gen底下

* feat: 生成 openviking-server 的 client

* feat: 搭建 openviking client 的适配层

* docs: 新增 ov-client 适配层描述

* chore: 清理项目模板

* clean: 清理模板样式

* deps: 新增 tanstack query 依赖

* style: 调整 shadcn 风格

* feat: 导入基础的shadcn组件

* feat: 复刻旧的 webconsole

* fix: 修复legacy代码commit不完整的问题

* docs: readme

* feat: 允许不显示传递自定义client

* dev: add development environment script

* feat: support tags for resource management and retrieval

This commit introduces a native `tags` parameter across the entire stack (Core, API, SDK, CLI) to
easily tag resources and filter them during semantic search.

Changes include:
   - **Core & Storage**:
    - Write `tags` to the resource root's `.meta.json` during `add_resource`.
    - Read tags from `.meta.json` during async semantic processing and hoist them to the VectorDB context for indexing.
    - Enrich directory stats/entries in `VikingFS` (`ls`, `stat`) with `tags`.
   - **API & Service**: Add `tags` field to resource creation and search routes.
   - **Python SDK**:
    - Add `tags` parameter to `add_resource`.
    - Add `tags` shortcut parameter to `find` and `search` methods, which automatically constructs the underlying `contains` metadata filters.
   - **Rust CLI**: Add `--tags` flag to `ov add-resource`, `ov find`, and `ov search` commands.
   - **Docs**: Update English and Chinese documentation for Resources, Retrieval, and Filesystem APIs to reflect the new `tags` parameters and structures.
   - **Tests**: Add unit tests for resource processor meta merging, VikingFS tag reading, and HTTP client tag filtering logic.

* feat(search): support tags filtering and return tags in retrieval results

* refactor(tags): extract build_tags_filter helper and improve validation

* chore(scripts): add fast mode toggle to bootstrap menu

* fix(tags): sanitize once and isolate semantic tags context

* feat: 三段式布局 + 功能页拆分

- 新增顶栏(全宽) + 左侧边栏 + 右侧内容区的三段式布局
- 将 Data 大页面拆分为独立路由: FileSystem、Find、Add Memory
- 将 Access 页面迁移为独立的 Settings 页面
- 侧边栏按 Data/Ops/Access 分组显示导航项
- 提取共享工具函数到 data-utils.ts
- 修复 .gitignore 中 data/ 规则误匹配子目录的问题

* feat(web-studio): add i18n support and dark/light theme toggle

- Add i18next with browser language detection (zh-CN / en)
- Add language switcher dropdown in header bar
- Add dark/light theme toggle with animated Sun/Moon icons
- Wire up next-themes ThemeProvider with class-based dark mode
- Replace shadcn dark theme with default Zinc (neutral gray)
- Connect sidebar labels to i18n translation keys
- Fix dropdown menu forced dark styling

---------

Co-authored-by: baojun-zhang <zhangbaojun.1@bytedance.com>
Co-authored-by: Jason <101583541+JasonOA888@users.noreply.github.com>
Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
Co-authored-by: Protocol Zero <257158451+Protocol-zero-0@users.noreply.github.com>
Co-authored-by: 灿烂甜菜 <731426007@qq.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: yc111233 <109650216+yc111233@users.noreply.github.com>
Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
Co-authored-by: Jiahui Zhou <zhoujiahui.01@bytedance.com>
Co-authored-by: MaojiaSheng <shengmaojia@bytedance.com>
Co-authored-by: openviking <openviking@example.com>
Co-authored-by: 13ernkastel <LennonCMJ@live.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: chenjw <chenjunwen@bytedance.com>
Co-authored-by: yeshion23333 <dutao.1786@bytedance.com>
Co-authored-by: heaoxiang-ai <heaoxiang@bytedance.com>
Co-authored-by: Yaoyao <yuyao.yoyo@bytedance.com>
Co-authored-by: kaisongli <likaisong@bytedance.com>
Co-authored-by: Octopus <liyuan851277048@icloud.com>
Co-authored-by: octo-patch <octo-patch@github.com>
Co-authored-by: AutoCoder <wulf234@163.com>
Co-authored-by: yangxinxin-7 <yangxinxin.24@bytedance.com>
Co-authored-by: Yang Zhi <yangzhi.see@gmail.com>
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
Co-authored-by: Shawn-o <64448366+Shawn-cf-o@users.noreply.github.com>
Co-authored-by: zgy <1670519171@qq.com>
Co-authored-by: chuanbao666 <sunchuanbao@bytedance.com>
Co-authored-by: 7. Sun <jhao.sun@gmail.com>
Co-authored-by: yepper <yangshunyao@bytedance.com>
Co-authored-by: mrj666 <33885009+mrj666@users.noreply.github.com>
Co-authored-by: yuan7he <yuan7he@gmail.com>
Co-authored-by: yuanqianhe <yuanqianhe@lattebank.com>
Co-authored-by: Sense_wang <167664334+haosenwang1018@users.noreply.github.com>
Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
Co-authored-by: ifeichuan <feichuan05@gmail.com>
Co-authored-by: Jye10032 <736891807@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants