Repository navigation
port: re-apply the #5898 token-guard fix on current main (resolves the CONFLICTING state) - #3
kuangmi-bit wants to merge 523 commits into
Conversation
…6721) * feat(ragfs): expose cache-backed leader leases to Python * fix(ragfs): harden leader lease lifecycle * fix(ragfs): tighten leader lease cancellation and release
…cengine#6723) * fix(tasks): fence admission and preserve accepted task ownership Allow safe withdrawal of unused tasks, serialize account access across event loops, and avoid rewriting retained MySQL task events. * fix(tasks): tighten admission checks and wait polling * fix(tasks): keep deletion cleanup independent of actors Use system ownership for durable identity cleanup tasks and keep wait polling policy internal so foreground waits stay responsive without exposing tuning knobs. * fix(tasks): allow legacy deletion cleanup owners Temporarily allow identity cleanup tasks to be recreated for legacy deletion fences whose owners are already being deleted, while keeping ordinary Task admission fenced. * fix(tasks): keep actor ownership for identity cleanup tasks Revert system ownership for delegated identity cleanup; the actor-being-deleted case is rare, so exempting cleanup tasks from identity admission is enough to keep deletion recoverable.
Co-authored-by: zhanghe.1216 <@bytedance.com>
* fix(import): enforce manage for ovpack and bypass ACL for reservation cleanup * fix(acl): authorize subtree operations once and retain destination ACL * fix(acl): simplify copy authorization and preserve destination permissions * perf(acl): check copy permissions against the complete file list * perf(acl): query denied subtree entries with reusable action filters
…volcengine#6598) The Kimi Code and CodeBuddy Code adapters returned early when the transcript had no unsent turns, before the commit decision. A Stop sends each finished turn but commits only after commitTurnThreshold (8) messages, so the SessionEnd, Interrupt and PreCompact that followed found nothing new and never committed the tail. Short sessions were never committed at all. When nothing is new, capture now still commits if earlier turns are uncommitted and the event's commit policy allows it, and a commit that lands in the pending queue also resets the counter, as Cursor does. Update the capability reference and the CodeBuddy notes to match.
… when auto-capture is off (volcengine#6597) * fix(codex-plugin): skip PreCompact capture and commit when auto-capture is off PreCompact was gated only on autoCommitOnCompact, so with auto-capture disabled it still appended the uncaptured transcript tail to the OpenViking session and committed it. Gate it on autoCapture as well, matching the Stop and SessionEnd hooks. * fix(pi): skip compaction and shutdown commits when auto-capture is off session_before_compact and session_shutdown only checked the connection and bypass, so with autoCapture: false they still committed the OpenViking session (and, under takeover, synced the branch before archiving it). Check the capture switch there too, as turn_end already does; under takeover pi falls back to its own compaction.
* refactor(admin)!: retire legacy session migration Retire the remaining 0.3.x session migration and cleanup workflow, including server, CLI, SDK and documentation entry points. Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> * fix(admin): keep migration endpoint reserved Return UNIMPLEMENTED for ROOT migration requests without scheduling work, while retaining the existing authentication and authorization requirements. Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> * fix(admin): return 400 for unsupported migration Keep the ROOT-only migration endpoint reserved and reject requests with INVALID_ARGUMENT while no migration operation is supported. Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> --------- Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
…olcengine#6752) Co-authored-by: TRAE CLI <traecli@bytedance.com>
…gine#6230) * fix(plugin): deduplicate repeated messages in capture batches * chore(agent-hook-plugin): bump version to 0.5.29 --------- Co-authored-by: zhengxiao.wu <zhengxiao.wu@bytedance.com>
* feat: add opt-in directory TTL integration hooks Co-authored-by: TRAE CLI <traecli@bytedance.com> * refactor(ttl): consolidate optional integration wiring Co-authored-by: TRAE CLI <traecli@bytedance.com> * fix(ttl): carry idempotent reset intents through internal bridge * docs(ttl): clarify asynchronous registration hook contract * fix(ttl): install write guards before workers and preserve retry source * refactor(ttl): move Redis directory runtime into the kernel * fix(session): use file-scoped leases for native writes * fix(expiry): preserve Redis endpoint TLS precedence * refactor(ttl): move Redis coordination into kernel * feat(ttl): move hourly maintenance into expiry scheduling * fix(ttl): keep registrations flowing during maintenance * fix(ttl): keep queue write registration on the service loop * fix(ttl): reuse session commit directory lock for guarded writes * perf(ttl): resolve root policies without scanning all roots * fix(ttl): use user settings and preserve soft expiry semantics * fix(ttl): share peer retention policy per user * test(ttl): cover expiry echo after shared policy updates * test(ttl): verify clearing user policy preserves other settings * docs(ttl): clarify shared peer events policy * fix(ttl): retry transient embedding lock contention * fix(ttl): exclude session registry sidecars from recycle units * fix(ttl): preserve session state leases and validate policy users * fix(ttl): remove redundant write-path directory locks * refactor(ttl): bound maintenance work to current policy ranges * fix(ttl): stagger backfill and recovery through expiry * fix(ttl): retire account state and avoid redundant archive stats * fix(ttl): unlink account state without synchronous reclamation * refactor(ttl): remove archive source checks from delayed writes * refactor(ttl): remove per-vector target filesystem checks * perf(ttl): keep policy reads and existence checks off write path * test(ttl): consolidate retention coverage into existing contracts --------- Co-authored-by: TRAE CLI <traecli@bytedance.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
…import script (volcengine#6003) * feat(plugins): link agent onboarding after install and add a history import script The installer now ends with a link to the agent onboarding guide, on the docs host the downloads came from (docs.openviking.net or .ai) and in the installer's language; bootstrap.sh's note for AI agents points there too. examples/memory-plugin-shared/import-history.mjs imports recent Claude Code or Codex sessions into OpenViking. It is a single dependency-free file for Node.js 18+, published under /dl/memory-plugin-shared/ on both docs hosts. It reads the plugins' connection, derives each session's peer the way the plugins do, sends user and assistant text only with secrets redacted, uses the session ids `openviking-server ingest` uses, commits each session once with auto-commit off, and skips sessions already imported or captured, so a second run imports nothing. Without --yes it only reports what it would do. * fix(plugins): list what was not installed and word the onboarding link for people Findings from running the one-click onboarding on Claude Code, Codex, TraeCode CLI, OpenCode, pi, Kimi Code and DeepSeek Harness: - A selected harness whose CLI was not found, a server that could not be reached or rejected the key, or a CLI that npm could not install was reported only as a warning near the top, and the install still ended with "Done" and the onboarding link. These are now repeated in a "Not done" list just before the link, where an agent reading the output looks first. - The closing line read as an instruction to the agent; some agents treated it as a prompt injection when the output landed in their conversation. It is now a plain label: "Onboarding guide (for your agent): <url>". - bootstrap.sh no longer addresses the guide link to AI agents; it is listed with the other reference links instead. - Run from inside a dsh session, the installer put the plugin into the web profile, so the session the user was in never loaded it. It now uses the session's profile (DSH_PROFILE when DSH_SHELL=1) unless --dsh-profile names one, and the dsh next step names the profile to start. - import-history.mjs: the dry run reads the server to find sessions already imported, so its header now says no conversation content was sent rather than nothing; "1 other project" is singular. * fix(plugins): tell Kimi Code users to start a new session instead of /reload * feat(plugins): let import-history read sessions from a JSONL file The history import script reads Claude Code and Codex sessions where those agents keep them. Other agents store history in formats it cannot read, so onboarding on them offered no import. `--input <file.jsonl>` with `--harness <name>` imports sessions an agent converted itself: one JSON object per line with the native session id, the cwd and user/assistant messages with ISO 8601 times. Everything after that runs through the existing pipeline: text cleanup, window, project and active-session filters, turn merging, secret redaction, truncation, the already-imported / captured-by-plugin check, batched writes and one commit. - Accepted with --input: claude, codex, trae-cli, cursor, trae, trae-cn, zcode, kimicode, opencode, pi, dsh, openclaw and hermes. Session ids use the openviking-server ingest source name where an adapter exists (opencode, openclaw, hermes), so the two importers skip each other's sessions. The live-session id and the peer follow each host's plugin; OpenClaw and Hermes get no derived peer, as their plugins don't use the shared one. - A malformed file is refused whole with line numbers and nothing is sent: not a JSON object, missing id or messages, a non-string user/assistant text, a relative cwd, or an id that repeats an earlier one after it is cleaned for a session id. Other roles are dropped and counted; sessions without any ISO 8601 time are skipped as undated; subagent sessions are skipped. - Without --input, hosts with no reader still print "not supported yet" and now point at --input. * feat(plugins): let import-history list sessions and import picked ones --list prints the sessions in scope with their ids, state and a preview of the first and last request, and writes nothing. --session <id>[,<id>...] imports just those sessions, whatever their project or age; an id that matches nothing, or more than one session, refuses the run before anything is sent. Sessions still active are skipped either way. This lets an agent import one kind of work the user names: list, pick the matching sessions, dry-run them, import after the user confirms. * fix(plugins): let an exact --session id win over a longer id it prefixes A full id that is also the start of another id (session-1 and session-10, or a Codex parent and its forks, whose native id is <parent>_<fork>) was refused as ambiguous. Exact matches on the native or import id now win; a prefix is used only when nothing matches exactly. --list no longer stops at the import default of 20 sessions (it lists up to 200 unless --max-sessions is given) and says how many sessions it left out and which option widens the scope. With --session, the JSON reports scope "picked" and no time window. A picked id that only matches an empty or plugin-internal session says so. JSON previews replace the title, and a missing first or last request is null in both fields. * fix(plugins): drop the note to AI agents from the installer headers Some agents read the paragraph as a script telling them how to treat the user's request and declined to run the installer. The header's summary and optional checks stay as they were.
… install surfaces (volcengine#6002) * docs(agent-integrations): add agent onboarding guide and link it from install surfaces Add a step-by-step onboarding guide that an agent fetches after running the memory plugin installer, in English and Chinese, served as raw Markdown at /agents/{en,zh}/onboarding.md on both documentation hosts. It covers checking the install, what runs automatically, an optional history import, an optional rule for hosts without OpenViking skills, the restart, and the first use in a new session, with a per-host table and troubleshooting. Add a human page, getting-started/07-agent-onboarding, with the one-click prompt, and point the agent catalog cards, the per-agent install pages and the README agent prompts at the guide. * docs(agent-integrations): fix onboarding gaps found by running it on each agent Changes after running the one-click onboarding on Claude Code, Codex, TraeCode CLI, OpenCode, pi, Kimi Code and DeepSeek Harness, and checking the Cursor, TRAE, TRAE CN and ZCode setup: - Prompt: ask to install the plugin "for this agent" and to continue with the official onboarding guide, make the sandbox request conditional, pass --lang so the installer and its closing link match the conversation, and say the key is used as is but not repeated (one agent replaced it with a placeholder). - Restart: warn against reloading plugins in the install conversation (Claude Code /reload-plugins, Kimi Code /reload) or resuming it, which saves it, key included; Kimi Code's row no longer recommends /reload. Cursor: start a new Agent chat rather than the restored one. TraeCode CLI: spell out the hook trust step. DeepSeek Harness: restart in the profile the installer printed instead of assuming web. - Install check: treat a "Not done" list as an unfinished install, accept English and Chinese output, and skip `ov health` when the installer already confirmed the server. - Import: a placeholder harness instead of a hard-coded codex, download and dry run in one command, and on other hosts offer Claude Code or Codex history when it exists. - First message after the restart: no project placeholder to fill, and it carries the import result so the new session doesn't guess it. After the restart: answer from the repository when nothing was recalled, and wrap up in the same reply. - Ground rules: never open ovcli.conf (use ov health or the health tool to show the server), don't mention step numbers, and count the import confirmation as part of the first question. - Per-host table: rules location for Kimi Code, MCP settings as the visible signal in Cursor and TRAE, Codex approval prompts, and new troubleshooting rows for a skipped host and for `ov` asking for a display language. - Human page: the new prompt, and a note that plugins don't yet remove the key from conversations they save. README prompts no longer ask about other tools before onboarding. * docs(agent-integrations): let the one-click prompt install into every detected agent The prompt no longer passes `--harness <agent>,cli`. Without `--harness` the installer installs into every agent it detects plus the `ov` CLI, which is what the one-click install should do by default. - Getting-started page (en, zh): drop the `<HARNESS>` placeholder and its table of values, word the prompt without "for this agent", and explain that other detected agents get the plugin too and each needs its own restart. `--harness <list>` is mentioned only as the way to limit the install, with a link to the unified installer section. - Agent guide (en, zh): the installer sets up more than the agent running it. The ground rule about other agents' configs now means "don't edit them yourself" instead of "only this agent changes". Step 1 and Step 5 talk about tools in the plural and tell the user the other tools need their own restart, pointing at the installer's `Next:` lines. Troubleshooting gets a row for a host the installer did not detect, which re-runs the installer with that host's `--harness` value from Appendix A. * docs(agent-integrations): offer a lasting collaboration rule on every host Step 4 of the agent onboarding guide used to offer one retrieval rule on TRAE, TRAE CN, ZCode and Kimi Code only. It now offers every host a short collaboration rule for the user-level rules file, so it applies to all of the user's projects: - use the injected OpenViking context first, and search or read only when it isn't enough; - keep important decisions (with reasons), progress and next steps, intermediate outputs and deliverables in the user's personal resources, one folder per project (for example viking://user/<user_id>/resources/<project>/), reusing folders the user already has; no routine conversation, no secrets, no unrequested uploads; read back after writing; - check that folder first when continuing a project, and update a superseded decision instead of keeping both; - say in one line where something was saved. The agent shows the full rule text before asking, since it lands in a file every project reads. It writes the rule between <!-- openviking:start --> and <!-- openviking:end --> markers: it replaces an existing block, appends otherwise, leaves the rest of the file alone, raises conflicting rules with the user, and reads the file back. It skips the question when the same block is already there. Hosts whose personal rules live only in settings get the text to paste. - Appendix A: the "OpenViking skills" and "Rule (Step 4)" columns become one "User-level rules file" column, given as a hint rather than a fixed path; TraeCode CLI and DeepSeek Harness are marked not confirmed. - Step 3: files the user names go to the same project folder in their personal resources instead of the account-shared viking://resources. - Intro: "don't show them this guide" becomes "no need to relay it; give the link if they ask", which agents read as concealment. - Getting-started page (en, zh): step 4 and the question count follow. * docs(agent-integrations): keep the agent's notes apart from imported resources The collaboration rule had the agent write its notes (decisions, progress, intermediate outputs, deliverables) into viking://user/<user_id>/resources/<project>/, the same folder the user's files are added to. That folder is where a project is naturally imported with add_resource and kept in sync with a watch, and a re-sync deletes whatever is not in the source, notes included. Notes now go to a separate tree, for example viking://user/<user_id>/resources/notes/<project>/. Files the user gives still go to resources/<project>/ with add_resource. The rule says never to use a notes folder as an add_resource target or to write notes into an imported folder. "When continuing a project" now points at its notes folder. The getting-started page (en, zh) follows. * docs(agent-integrations): import other hosts' history through a JSONL converter Step 3 told agents on hosts other than Claude Code and Codex that importing their own history isn't supported. The import script now takes `--input <file.jsonl>`, so on those hosts the agent writes a small converter for its host's session store and hands the file to the same script, which does the filtering, redaction, ids, peer, dry run and import. The guide (en, zh) gives the JSONL line format and the converter's rules, from three end-to-end runs (OpenCode, pi, Kimi Code) and a second round on pi and Kimi Code: - resolve the temp directory to an absolute path once and use it for every file, since file-writing tools don't expand ${TMPDIR:-/tmp}; - write every session in the store and leave project and time filtering to the script; leave out only this conversation, which holds the key; - only user and assistant text, nothing injected by the host or a plugin; - check the result from a summary, never print the file or the key; - report the dry run's skip reasons as printed, import after the user confirms, then delete the JSONL and converter everywhere they were written. Appendix A's history column now says where each host keeps its sessions (OpenCode, pi, Kimi Code, DeepSeek Harness, TraeCode CLI; not confirmed for Cursor, TRAE and ZCode). The "not supported yet" troubleshooting row points at --input. Step 4 tells the user and asks them to paste the rule when the write fails. The getting-started page (en, zh) follows. * docs(agent-integrations): open the agent guide with what OpenViking is Agents in testing (Claude Code, and Sonnet on OpenCode) treated the guide and the installer's agent-directed lines as possible prompt injection, partly because nothing in the guide says what project it comes from. The guide (en, zh) now opens with one factual paragraph: what OpenViking is, that Volcengine open-sourced it, the repository, its license and star count, and that the guide, the installer and the plugins all come from that repository. The wording and figures are the ones the installer header already uses (bootstrap.sh, install.sh) and the README tagline. * docs(agent-integrations): rebuild the zh agent guide on the PM's r3 draft Take the r3 rewrite as the base: each step starts from what the user should notice, explains the value before asking, shows the rule text and its effect in one confirmation, reads the import result back, and closes with next steps. On top of it: keep the source paragraph (agents reject the guide as prompt injection without it), keep cli in every install command (ov is needed for add-resource and Compile), ask for a new key in the user's own terminal instead of a conversation the plugin is already capturing, add importing one kind of work through import-history --list / --session, restore the Codex approval specifics, and say per host whether to resume the original session after the restart. Troubleshooting, the JSONL converter for other hosts and the extended reference move to their own pages. * docs(agent-integrations): bring the en agent guide and the human pages in line Mirror the zh rewrite in English: the guide, the troubleshooting and other-hosts pages, and the extended reference. The human onboarding pages describe importing one kind of work and drop the two-question promise. * docs(agent-integrations): resume the install session on Codex, keep a new session on Claude Code Tested in real TUIs: claude --continue and codex resume --last both bring the original session back with the plugin live. On Codex the install conversation is saved after Trust all whether the user resumes or starts a new session, so resuming costs nothing and spares the restart message. On Claude Code the first save after a resume back-fills the whole install conversation, key included, while a new session keeps it out, so Claude Code stays on a new session. Also keep <project> a placeholder in the rule: an agent filled in the current project, which would send every project's notes to one folder. * docs(agent-integrations): tell Codex users the install conversation is saved, and cover a bare 'restarted' On Codex the install conversation, key and import previews included, is saved to the user's own account once they trust the hooks, resumed or not; the guide now has the agent say so at the restart, with the option to replace the key afterwards. Resume hosts also get the restart message as a fallback, a bare 'restarted' with no earlier steps in the conversation goes to 'After the restart' to fill in what is missing, and the closing lines mention switching to another OpenViking account. * docs(agent-integrations): say what OpenViking is and whose key it is in the install prompt The one-prompt install now names the project and its repository, says the guide asks before importing history or writing a rule, and says the API key is the user's own and where the installer keeps it. The README prompts use the same wording with <SERVER_URL> and <API_KEY>; the self-hosted notes move to the text under each prompt. * docs(agent-integrations): ask one decision at a time, with the host's choice tool The guide told the agent to fold questions that fit one message into one message, so Codex asked the import scope and the collaboration rule as one numbered text list. Each decision now gets its own turn with its own benefit, and the agent asks it with the host's native choice tool when there is one (Claude Code AskUserQuestion; Codex request_user_input, which Codex only allows in Plan mode), the recommended option first and the tool's own custom input for anything else. What the user must read first, such as the dry-run counts or the full rule text, goes in a message before the tool call; without a usable tool the same options are asked in text. The import choices drop to three (recent 14 days, one kind of work, skip) with another project or time range as the user's own scope, and the collaboration step becomes one question asked after the full rule text, instead of a choice followed by a second confirmation. * docs(agent-integrations): keep the collaboration rule readable after hosts collapse progress In the Codex app the full rule text arrives as mid-turn commentary, which the app folds away once the turn ends; what stays is the final message and the question card, which only said "write the rule above". The question now carries a short plain-language summary of the rule and the file it goes into, the full text is still sent before asking and can be shown again as the reply body ("show the full text first"), and the status message after writing lists the summary and the file path again. The ground rule asks for self-contained questions at every decision for the same reason. Appendix A also names Codex's request_user_input_async, which models such as the gpt-6 series get in Default mode, next to the Plan-only request_user_input. * docs(agent-integrations): give each onboarding step its value, its actions and its message The onboarding guide is restructured around what the user should come away with at each step. Every step now has three parts: what the user should take away, what the agent does, and what its message to the user looks like. Value points (V1-V4, with the LoCoMo figures from the May 2026 benchmark post) give the agent something concrete to say, in terms of the user's own work. - The three decisions (import scope, go-ahead to import, collaboration rule) are marked as explicit choice-tool call points with the question text and options, recommended option first; free text stays the way to customise. With a tool that doesn't wait for the answer (Codex request_user_input_async), the agent calls it first and puts what the user must read into the last reply, which is what the Codex app keeps after it folds the turn. - Step 1 records the user name from `ov health` once; Steps 1 and 2 go into the message that asks the import scope. - Step 3 dry-runs with --json, skips the confirmation when everything in scope is already in OpenViking, and reads the imported work back with `ov search --mode context` before the restart, so the user sees what the import gave them. When `get-session-context` returns nothing for an imported session (no archive overview yet), it reads `archive_001`. - Step 4 shows the effect of the rule rather than its text, offers a role-based variant, and the rule keeps each project's work under resources/<project>/ with progress and decisions in notes/. - Step 5 has Codex and TraeCode CLI users trust the OpenViking hooks before quitting (/hooks in the CLI, the hooks icon in the Codex app), so the review prompt doesn't block the return. The step labels say "what you do" and the message rules ask the agent not to repeat commands rather than to hide them: Claude Code read the earlier "do silently" wording as a request to conceal actions and declined to follow it. Links stay absolute docs URLs. The English guide, the other-hosts page and the one-prompt onboarding page (zh/en) follow. * docs(agent-integrations): read imported work back from its memories Since OpenViking 0.5.0 turned Working Memory off by default, a commit no longer writes an archive overview, so `ov session get-session-context` returns nothing for an imported session. The import already waits for extraction, so the read-back now searches the project's memories with `ov find`, scoped to viking://user/<user_id>/peers/<projectPeer>/memories (or the user's memories when there is no peer), optionally `--after` the import, and reads one or two event memories with `ov read`. The session archive (`get-session-archive <id> archive_001`) is only the fallback when the user wants the original wording or nothing was extracted. This also drops `ov search --mode context`, which older ov CLIs don't have. * docs(agent-integrations): read back across the user's memories, in the message body The read-back searched only viking://user/<user_id>/peers/<project>/memories and missed what extraction files under viking://user/<user_id>/memories, such as cross-project entities. It now runs one `ov find` scoped to the user directory with `--context-type memory`, which covers both, and reads the most relevant entity and event memories in full. The read-back and the rule summary go in the body of the last reply; the choice card carries only a short summary and the decision. * docs(agent-integrations): show the rule text by default when agreeing on collaboration
…e#6729) * feat(studio): add confirmed resource deletion to terminal * feat(studio): add mkdir move and copy terminal commands * fix(studio): escape resource deletion URI completions * fix(studio): reject slash-only root deletion targets
* ci: prepare Vika release workflow for migration * fix(ci): initialize gateway kubeconfig path at runtime * Revert "fix(ci): initialize gateway kubeconfig path at runtime" This reverts commit 555e2f7.
* fix(memory): isolate URI failures and validate add-only creates * refactor(memory): unify add-only target resolution
Co-authored-by: TRAE CLI <traecli@bytedance.com>
* fix(langchain): preserve recall prompt cache prefixes Signed-off-by: Hao Zhe <haozhe4547@gmail.com> * fix(langchain): restore checkpointed recall provenance Persist pending context references with their assistant delivery ID until capture is acknowledged. Save delivery progress after commit-only recovery so a fresh middleware instance preserves provenance without replaying captured messages. Signed-off-by: Hao Zhe <haozhe4547@gmail.com> --------- Signed-off-by: Hao Zhe <haozhe4547@gmail.com>
…walkthrough (volcengine#6772) Co-authored-by: cuiwenzheng.byte <cuiwenzheng.byte@bytedance.com>
* perf(acl): reuse scoped authorization across filesystem operations * refactor(acl): limit optimizations to read operations
…ine#6697) * fix: skip-commit_unchanged * fix: harden Git watch SHA probing * fix(git): kill whole git process group on timeout/cancel * fix: avoid duplicate git ls-remote on watch * refactor(git): resolve head SHA in preflight and drop accessor self-probe - preflight runs a targeted ls-remote (HEAD or tracked branch) and carries the advertised SHA to the worker via a transient AddResourceMsg.git_head_sha_hint - GitAccessor no longer issues its own ls-remote: resolved SHA only comes from a commit pin or the upstream hint; otherwise the ref is downloaded by moving branch name without recording a checkpoint - strip git_head_sha_hint from persisted watch processor kwargs - scheduler probe gate, fail-open refresh and clone local-HEAD checkpoints are unchanged --------- Co-authored-by: chenxiaobin.monkey <chenxiaobin.monkey@bytedance.com>
…ne#6719) * fix(compile): reject image sources before text reads Co-authored-by: TRAE CLI <traecli@bytedance.com> * fix(compile): consume native image evidence through multi-read * fix(compile): narrow image support to existing evidence reads * fix(compile): format native image tool results in request traces * fix(compile): reuse image snapshot during evidence reads * fix(compile): dispatch bounded image references to memory workers * fix(compile): reuse registered image metadata for payloads --------- Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: zhanghe.1216 <@bytedance.com>
…lcengine#6745) * fix(pathlock): recover durable handoffs after provider migration Reacquire complete logical coverage under fresh ownership when persisted filesystem handoffs resume on Redis, and verify backlog consumption through durable completion and ACK. * docs(pathlock): clarify filesystem to Redis lock provider switch Explain that migration changes path lock coordination while keeping business files and persistent QueueFS storage in place. * docs(pathlock): require process and heartbeat shutdown before lock switch Make the migration exit check explicit because filesystem and Redis locks cannot coordinate concurrent writers, while preserving recovery without waiting for stale tokens to expire. * fix(pathlock): bound blocked recovery retries and verify concurrent consumers Require account context, expose recovery alerts, and settle exhausted work so durable queues converge under persistent contention. * style(pathlock): apply rustfmt to handoff recovery changes * fix(pathlock): preserve work when handoff replacement enqueue fails Keep existing work recoverable after an uncommitted retry enqueue fails so the original delivery can execute after restart. Cover real queue middleware and SQLite recovery across all handoff retry consumers. * docs(pathlock): clarify recovery retry limits per delivery chain Explain how a crash before ACK can fork delivery chains, so the message counter does not enforce a global retry limit for one work.
…ine#6751) * perf(ci): avoid redundant native builds and reuse test artifacts Reduce runner contention with PR cancellation, change-aware job selection, compiler caches, and validated same-run native and Studio artifacts. * fix(ci): limit cache writes and cover runtime Markdown Keep shared compiler caches stable and writable only from official main runs, preserve the cuVS required check context, and prevent runtime skill and prompt files from bypassing API tests. * fix(ci): refresh compiler caches across main revisions Version immutable cache entries by commit while restoring compatible prefixes so later main builds retain new compiler output. Preserve main-only writes and cover cache rollover, PR restores, toolchain isolation, and legacy entries. * feat(ci): enable manual native builds on dedicated runner Allow trusted manual runs to use ov-ci-runner in an Ubuntu 24.04 container while preserving native artifact compatibility and hosted PR defaults. Add a Linux-only trial option and cover runner selection boundaries. * feat(ci): use ov-ci-runner for automatic native builds Route official PR, scheduled and release native builds to the dedicated runner to reduce hosted queueing, while retaining a manual hosted override. * feat(ci): route Linux CI to dedicated runners Keep service-dependent P0 memory tests on openviking-ecs and default other Linux x64 tests and builds to ov-ci-runner. Preserve platform matrices and add explicit container dependencies and Docker test cleanup for persistent hosts. * fix(ci): preserve Hermes checkout trust across HOME changes Scope Git safe.directory settings to the two CI checkouts through inherited environment configuration so container ownership checks do not block installer validation. * fix(ci): validate build reuse on GitHub-hosted runners Return ordinary tests and builds to hosted runners so execution savings can be measured independently of self-hosted capacity. Keep the existing P0 memory suite pinned to its original ECS host. * fix(ci): preserve plugin tests for marketplace-only changes * test(ci): consolidate build reuse contract coverage --------- Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
…ne#6770) * fix(session): preserve retained previews during compression Archive full oversized assistant steps before writing budgeted retained previews, keep retained preview truncation split between head and tail, and pass the message created_at date into Working Memory compression prompts. Co-authored-by: TRAE CLI <noreply@bytedance.com> * fix(session): anchor WM compression by turn time Group working-memory compression input by conversation turns and attach each turn's created_at date so relative time references resolve against the correct turn. Co-authored-by: TRAE CLI <noreply@bytedance.com> * fix(session): remove redundant WM prompt date Co-authored-by: TRAE CLI <noreply@bytedance.com> --------- Co-authored-by: gaolingxiao <gaolingxiao@bytedance.com> Co-authored-by: TRAE CLI <noreply@bytedance.com>
* feat(admin)!: add group members in batches
Replace the single-user add endpoint with a validated user_ids array. Apply additions atomically in file and MySQL stores and invalidate Redis memberships for every affected user.
BREAKING CHANGE: PUT /accounts/{account_id}/groups/{group_id}/members/{user_id} is replaced by PUT /accounts/{account_id}/groups/{group_id}/members with a user_ids JSON array.
* refactor(admin): remove single-member add helpers
Remove the obsolete add_group_member methods from the manager, store contract and all three providers. Migrate server fixtures and tests to add_group_members with singleton arrays where appropriate.
* test(admin): check batch errors through full app
* test(admin): consolidate batch group membership coverage
---------
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Co-authored-by: zhanghe.1216 <@bytedance.com>
…lcengine#4786) Co-authored-by: r266-tech <r266-tech@users.noreply.github.com>
* fix(storage): 修复增量导入分页漏读并按 URI 补查 * fix(storage): 按 50 个 URI 批量补查索引
volcengine#7466) * feat(coordination): share persisted revisions and expire per-key state Unify leases and revisions in Rust so only persisted work supersedes older tasks, while one-day per-key retention and lease cleanup bound coordination state. * fix(coordination): avoid blocking leader initialization Initialize coordination through the async candidate entry and preserve deprecated Watch provider selection, with explicit coordination settings taking precedence.
…lcengine#7328) * feat(memory): replace soul and identity extraction with static AGENT.md * feat(bot): prefer OpenViking AGENT.md over local SOUL.md * refactor(memory): rename static AGENT.md to SOUL.md * fix(docs): restore file tree demo formatting * refactor(memory): preserve lowercase soul.md URI
…e#7313) Co-authored-by: r266-tech <r266-tech@users.noreply.github.com>
…olcengine#7325) * fix(parser): preserve literal dash-only AnyDoc paragraphs * fix(parser): preserve literal equals underline text in paragraphs
…ine#7314) Co-authored-by: r266-tech <r266-tech@users.noreply.github.com>
volcengine#7202) _resolve_anchors() collected *linked* anchor targets only from document-body inlines; the note traversal collected anchor definitions only. A note hyperlink pointing at a bookmark defined in the body was therefore never added to `linked`, the bookmark stayed unresolved, and the renderer dropped the note link to its plain label (a real DOCX whose only reference to the bookmark was inside a footnote triggered this). Mirror the body traversal in the note traversal: inline links whose target is an anchor are added to `linked` (note anchor definitions are still collected). Links to unknown targets keep falling back to their label. Regression tests (fake AnyDoc document models, no DOCX fixture): note-only link to a body bookmark is resolved and rendered as an anchor + `[label](#target)` (fails on upstream), body+note links still both render, unknown target still falls back. pytest 3 passed; ruff check clean.
…ngine#7490) * fix(react): filter internal metadata in FileBrowser text reads * fix(react): preserve YAML scalar comments in memory reads * fix(react): reject unterminated YAML scalar ranges
…cengine#7506) Breaking changes to @openviking/react (0.x, minor bump via changeset): - Tui is now CommandConsole (components/command-console). Its types, CSS classes (ov-command-console*), CSS variables (--ov-ui-command-console-*) and the Console module's labels.tui (now labels.commandConsole) follow. - FileBrowserEntries is now FileBrowserActionBar (components/file-browser-action-bar). - The six login components move under components/auth/; export names are unchanged. - LoadingState is no longer exported from components/file-preview. Internal cleanup: - src/shared/components is now src/shared/primitives. - Remove the README-only hooks/ and utils/ directories and the file-preview DESIGN.md working draft. Docs: - Rewrite the zh/en component and module pages around one structure (intro, when to use, import, examples, API tables) and add an internationalization guide. - Generate the zh/en sidebar from docs/sidebar.ts. - Name the navigation categories 业务组件 / Business components and 区块 / Blocks. Only the labels change; the modules/ path, package exports and CSS entries stay as they are. - Slim the per-component READMEs to stubs that link to the docs site. - Add writing and naming rules to frontend/AGENTS.md.
…des (volcengine#7499) * feat(ui): implement the file browser search with four retrieval modes Replace the placeholder search dialog with a full implementation matching the console design and the open-source studio's behaviour. Four retrieval modes share one input and one result list: `find` and `search` call the semantic endpoints, `grep` and `glob` the pattern ones, and all four normalise into one `SearchHit` so the view only ever sees one shape. grep hits keep their line numbers and are never deduplicated — several matches in one file are distinct results — while semantic hits deduplicate by URI because one resource can appear in two groups. Search runs as you type after a 400 ms debounce, with no submit button, matching studio. An advanced panel filters by directory, content level and time, enabling each group per mode and dimming the ones the mode cannot honour. Directory candidates derive from `rootUri` with the `~` alias, so they still point at the current user after an account switch. Clicking a result closes the dialog, locates the resource in the tree and opens its preview; ⌘K toggles the dialog, with only the most recently interacted instance answering when a page mounts several. Fork three controls from Arco into `shared/components/` rather than pulling in the whole library: Checkbox, Radio and a single-day DatePicker. They keep Arco's interaction logic, take their visual rules from the console's volcano theme, and expose no nested groups — `Checkbox.Group`, `Radio.Group` and `RangePicker` are deliberately absent, so tree shaking stays straightforward. Only what is used is forked. The DatePicker depends on dayjs for arithmetic and parsing, uses `Intl` for human-facing month and weekday names, and routes every date sent to an endpoint through `toApiDate`, which fixes the `YYYY-MM-DD` shape the server validates. Two defects found while reviewing are fixed here: `experienceDateRange` now rejects a non-positive day count instead of producing a range whose start is after its end, and the endpoint's UTC boundary is documented so a later change does not shift the filter window by a day. `mergeLabels` merges nested copy key by key, so overriding one search mode no longer blanks the others. Validation: lint, typecheck, 482 tests, full build and browser checks (grep results, mode menu position, date selection, dark theme, 375 px) all pass. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(ui): address file browser search review findings Six issues raised on volcengine#7499, each reproduced against the built output first: - **P1 mode switch unreachable without results.** The switch lived inside the row that only rendered when results existed, so a failing or empty semantic search — exactly when another mode is needed — had no way out. The mode row is now its own component rendered in every state, carrying the count only when there is one. - **Directory candidates widened the scope.** A narrow `rootUri` offered the ancestor that covers it, so selecting it swapped `target_uri` from the project root to the whole library. A retrievable narrow root now offers itself. - **Multi- to single-select left stale scopes.** Two checked entries showed as one radio while the request took the first. `normalizeFilters` collapses scopes and clears the filters the new mode cannot honour, at the switch, so the display and the request consume the same value. - **Local-calendar subtraction shifted the UTC window.** Across a DST transition a local day holds 23 or 25 hours, so `subtract(..., 'day')` could format one day early (measured in America/New_York across the 2026-11-01 DST end: 10-27 instead of 10-28). The subtraction now runs in UTC. - **Selected day never highlighted.** Cells were built from `dayjs()`, carrying the current clock, while the selected value was zeroed — zero of 42 cells matched. Both sides now start from the same midnight. - **Date picker copy ignored the locale.** Calendar, month navigation and clear labels were hard-coded English, so a Chinese dialog was read out in English. They now resolve from typed zh-CN/en-US resources, with explicit props winning. Validation: lint, typecheck, 600 tests (including new coverage for each fix), full build. The date-range tests assert UTC dates and pass under UTC, Asia/Shanghai and America/New_York. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(ui): address second round of file browser search review Three issues from the follow-up review: - **glob directory URIs carried a trailing slash.** The server marks directory matches with one (`_glob_match_uri`) so a flat string list can express the type, but `ls` and tree node ids carry none. Keeping it made a click set the current URI to `docs/` while the loaded `docs` row stayed unselected. Normalisation now strips it and records the directory fact on `SearchHit.isDir`. - **Scopes survived a root change.** With `rootUri` switched from project-a to project-b the selection still named project-a: the panel showed nothing checked while the request sent `target_uri: ["viking://resources/project-a"]`, returning results from outside the current tree. The effective filters now keep only the scopes the current root offers, computed during render, and both the panel and the request consume them. - **UTC arithmetic used native `Date`.** It kept the UTC semantics the previous fix established but contradicted AGENTS.md's "日期算术与解析用 dayjs". The subtraction now uses a fixed millisecond duration on dayjs, which matches the UTC calendar; the DST regression tests still pass under UTC, Asia/Shanghai and America/New_York. Validation: lint, typecheck, 601 tests and the full build pass. Co-Authored-By: Claude Code <noreply@anthropic.com> * style(ui): format the module docs after the merge Resolving the merge conflicts by splicing table rows left the property tables misaligned, which the CI format check rejects. Prettier realigns them; the text is unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
…ne#7510) * feat(react): add headless VikingBot module and Console chat * fix(react): address VikingBot history and draft ownership review
* feat(user): seed GLOBAL_POLICY.md during initialization Create the default access policy when initializing a user's workspace so new users receive the prescribed Global Agent sharing policy. * feat(user): make global policy preset opt-in Reuse server.user_config_defaults.preset_global_policy with a false default so deployments can enable the template during user initialization. * docs: omit global policy preset configuration documentation * refactor(user): bind preset configuration during service setup Share the existing UserConfigDefaults object with the directory initializer and preserve the initialization method signatures. Keep tests unchanged.
* feat: export offline metric events through configurable Kafka reporter * fix: package Kafka reporting and adapt current storage writer * fix: preserve deployment model credential ownership in reporting * fix(auth): support file account stores on read-only replicas * fix(auth): reject read-only identity writes before workspace locking * fix(metrics): preserve memory schema and queued task attribution * fix(metrics): attribute external Compile outputs at snapshot commit * fix(metrics): preserve memory task and type provenance * Preserve credential billing ownership in model usage events * Preserve model billing ownership through trusted account provisioning * fix(observability): address offline metric review findings Bind shared memory batches to current Task provenance and preserve multi-source attribution without duplicating model usage. Report successful incremental resource deletions. Read lightweight task status before loading terminal details. Add timer/merge/storage and Task Work regressions; update English and Chinese reporting semantics. * fix(observability): 将 Kafka 上报配置迁到 ov.conf --------- Co-authored-by: guanyuan.chen <guanyuan.chen@bytedance.com>
…ine#7524) * fix(react): support host navigation in Console conversations Keep internally owned responses active when the host echoes a new session ID. Preserve host session metadata, invalidate pending draft callbacks on navigation, and deliver every explicit New action even before session creation completes. Include regressions for both reviewed failures and host URL reflection. * fix(react): notify every explicit Console session selection
volcengine#7513) * feat(studio): improve Compile first-use workflow * fix(studio): refresh filesystem caches after Compile completes * feat(react): 封装可配置的认证表单组件 * feat(react): align file tree and preview with console UI * feat(react): align shared file previews with console controls Give standalone FilePreview and FileBrowser the same capability-based preview, source, copy and edit controls. Align tab spacing, summary indicators and source wrapping, and wire module editing and internal Markdown images through scoped native content requests. * chore(ui): reconcile fork navigation and theme formatting * fix(react): decouple auth validation from localized copy Store validation issue keys separately from rendered labels and resolve auth copy through the inherited locale. Cover empty label overrides, provider language changes, and invitation copy. * fix(react): localize experience injection rate formatting * ci(react): automate npm releases with Changesets * ci(react): publish source changes as next-stable betas * chore(react): release 0.1.8 * fix(react): skip unavailable directory tour steps and match designs * fix(react): skip unavailable directory tour steps and match designs * fix(react): refine file browser preview and defer Wiki config loading Load Compile configuration only when opening a Wiki board. Match the edit toolbar to the console header, render front matter only in Markdown preview, and let the 16px resize handle overlay a 1px divider. * fix(react): match console copy path hover style * feat(react): order file tree context roots like the console * fix(react): match the console preview empty state * feat(react): align Console and file browsing with Volcengine * fix(react): recognize YAML flow front matter in file preview * feat: 规范 * feat(react): integrate file navigation and four-mode search Use the tested navigation and directory tour from PR volcengine#7508 and the frontend changes it depends on. Retain the upstream document structure and Wiki metadata handling. * feat: save, compare and restore file versions * fix(react): honor version note labels and reveal home aliases * feat(react): let hosts control the Agent connection drawer * fix(react): preserve errors from home alias lookup * refactor(react): keep file history read-only Keep revision preview, copying, and comparison. Move versioned saves and single-file restore, along with their server changes, into a follow-up. --------- Co-authored-by: OpenViking Fork Sync <openviking-fork-sync@users.noreply.github.com>
Release @openviking/react 0.1.9 from main. Synchronize the package version, docs dependency, workspace lockfile, and changelog. Validation: 846 frontend tests, scoped lint, type checking, library and docs builds, and independent React 18.2 / 19.0 artifact consumption.
…ing (volcengine#7537) The slot never knew what a dashboard was: FileTree renders whatever the host returns, and the board entry is one use of it. The old `renderDashboard` name read as if the component owned dashboard semantics, which live in the FileBrowser module. The CSS class `ov-file-tree__dashboard` follows the rename to `ov-file-tree__trailing`. FileBrowser's own `renderDashboard` prop — the one that replaces the content of a dashboard tab — keeps its name and meaning; only the FileTree slot changes. The slot now aligns itself to the right edge of the row, so a host no longer needs to give its content `margin-left: auto`. When the row also shows a trailing marker such as the level or access text, the slot follows it directly, which matches how the console tree places its board indicator. BREAKING CHANGE: `FileTree`'s `renderDashboard` prop is now `renderRowTrailing`, and the slot's class is `ov-file-tree__trailing`. Update the prop name and any CSS that targeted the old class. Co-authored-by: Claude Code <noreply@anthropic.com>
…olcengine#7536) * feat(react): add lazy CodeMirror editing with shared Prism highlighting * fix(react): preserve keyboard focus in FilePreview editors Show inset focus outlines for keyboard navigation in CodeMirror and the textarea fallback. Track pointer focus per editor because text inputs also match :focus-visible when clicked, keeping pointer editing borderless. Document the five synchronization Effects, their external inputs, cleanup, and stale asynchronous result handling. Validation: scoped lint, typecheck, 908 tests, full build and built-docs browser checks for Tab/Shift+Tab, pointer focus, editor load failure, save retry, light/dark themes, 390px layout and Markdown backdrop retention.
…ine#7541) * feat(react): align the experience dashboard with the console Rebuild ExperienceDashboard against the Volcengine console's 1112 release: a dotted board surface, icon-bearing tabs, a shortcut time-range popover, dashed metric dividers, outcome-coloured trajectory rows with copy and open actions, a source-trace disclosure, and one card per test message. The directory view gains a numbered pager driven by `data.total`/`pageSize`, while the Impact tab pages trajectories by load-more through `hasMore`. Add the optional `ExperienceTrajectory.outcome` field and the `pageSize` prop, rename several labels, and fork the console's Pagination into `shared/primitives/pagination` (minimal: page items, `...` jumpers, active and disabled states) with five new icons. Three defects surfaced by running against a live OpenViking service: - The directory table collapsed its file column to 0px in narrow hosts because the fixed columns alone exceeded the container. Keep the column at 180px minimum and scroll the 560px table horizontally, the console's own rule for embedded lists. - A trajectory whose `name` came back empty rendered a blank row. Fall back to the file name in its URI. - Trajectory times printed the endpoint's raw ISO timestamp. Format them for the interface language. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(react): address experience dashboard review comments - Accumulate trajectory pages in the block's loader instead of replacing them. `useDashboardQuery` hides stale data when its identity changes, and the identity includes `page`, so "load more" used to drop the pages already on screen. The loader now walks from the first page up to the requested one, and a date-range or tab change resets `page` to 0. - Pass `onLoadMore` only when `onPageChange` exists, so the load-more button is actually disabled without a host callback. - Catch `URIError` when percent-decoding a trajectory's file name. A bare `%` such as `discount-50%.md` threw during render and blanked the board. - Carry `page`, `jumpPrevious` and `jumpNext` through the label pack so a zh-CN interface no longer announces English pager names. - Move the range popover's shadow into `--ov-ui-overlay-shadow-default` instead of a literal `rgb()` value. - Parse trajectory times with dayjs, per the repository's date rule, keeping `Intl` for the human-facing format. Tests cover page accumulation across load-more, the disabled button without `onPageChange`, a bare-percent URI, and zh-CN pager names. The accumulation test was verified to fail against the previous behaviour. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(react): keep loaded trajectories while paging and on failure The previous fix replayed every earlier page on each "load more" and left `page` inside the query identity, so a pending or failed request still emptied the timeline and the request count grew quadratically. Trajectories now own their paging in `useExperienceTrajectories`: loaded pages stay in the Hook, "load more" requests only the next page and appends it, and the request count grows linearly. Waiting and failing keep the rows on screen; a failure shows its error and retry below the list instead of replacing it. Changing the resource, account or date range resets the whole set to the first page. State transitions live in `experience-trajectory-pages.ts` and the single page request in `experience-trajectory-page.ts`, keeping both the Hook and the page reader under the file-length limit. The component gains `loadingMore` and `onLoadMore`; `onLoadMore` is only wired when the host provides a callback, so the button is disabled otherwise. Tests cover page accumulation, a delayed response keeping the rows, a failed page keeping the rows with an inline retry, the offset sequence growing by one page per request, and a late response for a previous resource being ignored. The accumulation test was verified to fail against the replay-all behaviour. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(react): abort in-flight trajectory requests and keep onPageChange Two regressions from the paging rework: - The request controller was created but never aborted, so switching resource, disabling the tab or unmounting left the connection open and a late response could still write. `load` now aborts the previous request before starting a new one, and the first-page effect aborts on cleanup. - The component stopped calling `onPageChange` for load-more, which the published API and both language docs still promise. An explicit `onLoadMore` still wins; otherwise `onPageChange(page + 1)` is used, and omitting both keeps the button disabled. Docs list `onLoadMore` and `loadingMore` in both languages. Tests cover aborting on unmount and on resource switch, the legacy `onPageChange`-only host, and both callbacks omitted. The two abort tests were verified to fail without the abort calls. Co-Authored-By: Claude Code <noreply@anthropic.com> * docs(react): state the trajectory append-failure exception The `error` row and the `states` note in both languages still claimed an error only shows while a section has no data, but an appended trajectory page that fails keeps the loaded rows and shows its error and retry below the list. Document that exception, and correct the `onLoadMore` type comment: the button is disabled only when both callbacks are omitted. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
Bump `@openviking/react` to 0.1.10 and point the docs workspace at it. Co-authored-by: Claude Code <noreply@anthropic.com>
…ent main main rewrote openviking/utils/embedding_input.py between the PR base (4c9a755) and 13738af: estimate_embedding_input_tokens() was deleted and truncate_embedding_input() became a linear quarter-token scan, which is why the PR now reports CONFLICTING (three hunks in this one file). This commit re-applies the PR's semantics on top of the current file instead of resolving the merge literally, because main's version does not count the truncation suffix inside the budget it enforces: - keep DEFAULT_CJK_TOKENS_PER_CHAR (2.0) and the per-code-point _CJK_RANGES table (now including 0x1F200-0x1F2FF, 0x20000-0x2FA1F, 0x30000-0x323AF); - price non-CJK non-ASCII at its UTF-8 byte length (the byte-level ceiling); - restore estimate_embedding_input_tokens() and count the suffix inside max_tokens, so estimate(truncate(t, n)) <= n holds. truncate_embedding_input() keeps its optional cjk_tokens_per_char argument, so the three existing call sites in openviking/models/embedder/base.py, openai_embedders.py and utils/embedding_utils.py are unchanged. Tests: same file as the PR (tests/unit/test_embedding_input.py), 11 passed.
|
Closing this in favour of a comment on volcengine#5898, because the comparison here is unusable: my head is based on current The port itself is intact and stays on the branch:
The fastest route is |
PR-Agent command was not runGitHub returned an incomplete or inconsistent changed-file set for this pull request, so PR-Agent stopped instead of analyzing only part of it. GitHub limits changed-file responses to 3,000 files. If this pull request changes more than 3,000 files, split it into smaller pull requests and run the command again. Otherwise, retry the command. |
A port of this branch onto current
main, because volcengine#5898 now reportsCONFLICTINGand a literal rebase is not enough.Why it conflicts
mainrewroteopenviking/utils/embedding_input.pybetween the PR base (4c9a755b) and13738af5:estimate_embedding_input_tokens()was deleted, andtruncate_embedding_input()was replaced by a linear quarter-token scan (_CJK_RUNregex +max_units), which no longer has an estimator to consume.That is why the merge produces three hunks in this one file: the PR rewrites the estimator that
mainremoved, and changes the truncation loop thatmainrestructured. The other file in the PR (tests/unit/test_embedding_input.py) does not exist onmainat all.A literal
git checkout --ourson the conflicted file would dropmain's rewrite; a literal--theirswould drop the fix. So this branch re-applies the semantics of your PR (and of the two commits you already cherry-picked,bdf5e425e+53c91dc11) on top of the current file:DEFAULT_CJK_TOKENS_PER_CHAR = 2.0and the per-code-point_CJK_RANGEStable are kept, including0x1F200–0x1F2FF,0x20000–0x2FA1Fand0x30000–0x323AF;main's 1/4-token bucket;estimate_embedding_input_tokens()is restored and the truncation suffix is counted insidemax_tokens, soestimate(truncate(t, n)) <= nholds.main's version appends the suffix outside the budget, which is the second half of the Embedding input token estimator undercounts CJK by ~60% — oversized single-string inputs reach the provider (embedding error 1210) even under max_input_tokens volcengine/OpenViking#5895 report.truncate_embedding_input()keeps the optionalcjk_tokens_per_charargument, so the three existing call sites (models/embedder/base.py,models/embedder/openai_embedders.py,utils/embedding_utils.py) need no change.Readings
The project's dependency stack (loguru, litellm, scrapy, cairosvg…) is not installed in my sandbox, so I ran your test file through a stub-import harness that loads
openviking/utils/embedding_input.pydirectly and executes the same 11 test functions/assertions:mainas-is (13738af5)DEFAULT_CJK_TOKENS_PER_CHARandestimate_embedding_input_tokensdo not existSo the tests cannot even collect against current
main: they pin an API the rewrite removed.What to do with it
Either cherry-pick this single commit onto
fix/5895-cjk-embedding-estimate-bound, after which volcengine#5898 should go back to mergeable, or merge this PR into the branch directly.Your call on whether the estimator should come back at all — if you would rather keep
main's linear scan and add the byte-ceiling/suffix accounting inside it instead of restoring anestimate_*function, say so and I will rewrite it that way; the invariant tests are what matter, not the shape.No tokenizer constants were measured by me; the 2.0 headroom value and the range table are yours.