Repository navigation
feat(plugins): skip recall digest compression for short prompts - #8026
2SinceJuly wants to merge 9 commits into
Conversation
Every UserPromptSubmit paid an 8-14s host model round trip for a digest, including replies like "yes" or "proceed" where the digest adds little over the assembled block. recallCompressMinPromptChars (default 0, off) skips both the local compressor and the server rewrite when the user's prompt is shorter than the threshold, and injects the assembled context directly. The length is measured after stripping host-injected <system-reminder> blocks, so the desktop app's prompt prefix does not make every turn look long. Hosts share the decision through memory-plugin-shared; the vendored copies were rebuilt with its sync script.
|
CI on this branch is still |
|
I combined this head ( The standalone #8026 head returned 1 from |
…ression skip The change reaches examples/memory-plugin-shared/lib, which every host packages, so each manifest has to move or installed hosts keep running the previous build. The first entry's two manifests rise to 0.7.27 as volcengine#7645 does; whichever lands first owns that number and the other rebases onto the next one. Merges current main into the branch.
|
Bumped all seven manifest entries at Rerun after the merge: 651 passed, 2 failed in |
|
Keeping Claude at The combined heads still passed 208 focused tests and the |
|
Acknowledged — keeping Claude at No further changes here; this is ready for your review. |
|
I found a Magpie regression while reviewing I tested the Magpie runtime with a temporary Passing |
The short-prompt skip is decided inside buildContextSearchBody, but the Magpie runtime built the body first and assigned recallBody.query afterwards. The builder therefore always saw an empty prompt, so the rewrite flag was computed as if every turn were long and recallRewrite server/auto kept sending a rewrite request for short prompts. Pass the query as an option so the skip applies, and cover both sides of the threshold in the plugin test.
|
Fixed in 6f2f9e8.
Added a regression test in Tests run locally: |
|
Retested
On macOS with Node v26.13.1, the Magpie plugin tests had 149 passes and one skip for the Bun host integration. The two shared recall suites passed all 49 tests, and |
|
Rebased the branch on current |
main moved every plugin manifest one patch ahead (volcengine#8093 and others), so the version bumps this branch carries for the short-prompt compression skip collide with it. The bump has to sit on top of main's number rather than overwrite it, so each manifest here takes main's version plus one. Conflict hunks were version lines only; the memory-plugin-shared tests still pass.
|
Merged current Checked after the merge:
No behaviour change beyond the merge. |
main moved the plugin manifests to 0.7.30 since the last merge (volcengine#8093 and others), so the version bumps this branch carries collide with it. Each conflicting manifest keeps main's number plus one, following the same convention as the previous merge: 0.7.31. Conflict hunks were version lines only. Ran the memory-plugin-shared recall tests (51 pass) and the magpie plugin tests (51 pass, 1 skipped).
# Conflicts: # examples/claude-code-memory-plugin/.claude-plugin/plugin.json # examples/claude-code-memory-plugin/package.json # examples/magpie-memory-plugin/package.json # examples/pi-coding-agent-extension/package.json
Every host packages examples/memory-plugin-shared/lib, which this branch changes, so each manifest has to move past the version main now ships or installed hosts keep running the previous build. Merging main left the three conflicting manifests on main's numbers; this lifts all seven plugins and the agent-hook host manifests to the next patch.
|
Merged Verified locally: GitHub now reports the PR as mergeable; the only remaining requirement is review. |
Description
UserPromptSubmitcompressed the retrieved context on every turn, so a reply like "yes" or "proceed" waited for a host model round trip (8–14 s in the report) before the agent started. Short prompts carry little query signal, so the digest adds little over the assembled block while costing the most.This adds
recallCompressMinPromptChars(default0, i.e. today's behaviour). When the user's prompt is shorter than the threshold, the hook skips both the local compressor and the server rewrite and injects the assembled context as-is. Length is measured after stripping host-injected<system-reminder>blocks, which would otherwise keep every turn above any threshold in the desktop app.The body builder keeps deciding intent, not mechanics:
fetchAssembledContextnow passes the query intobuildContextSearchBody, and that function omitsrewritefor a short prompt. Hosts share the decision throughexamples/memory-plugin-shared/lib, and the vendored copies were rebuilt bymemory-plugin-shared/sync.mjs.Human Involvement
Related Issue
Fixes #7654
Type of Change
Changes Made
recall-compress-core.mjs: adduserTypedPromptLength(strips host<system-reminder>blocks) andskipsCompressionForShortPrompt, and gatecompressRecallContexton it before the existing input-length check.recall-core.mjs: passqueryintobuildContextSearchBodyand omitrewrite(explicit and auto) when the prompt is short, so the server does not spend its own model round trip either.config-schema.mjs: declarerecallCompressMinPromptChars/OPENVIKING_RECALL_COMPRESS_MIN_PROMPT_CHARS, default0.recall-compress-core.test.mjsandrecall-core.test.mjs.Testing
node --test examples/memory-plugin-shared/{recall-compress-core,recall-core}.test.mjs→ 49 passed (rerun on the merged branch).The memory plugin's own script tests → 59 passed.
node --test examples/memory-plugin-shared/*.test.mjs→ 651 passed, 2 failed; the two failures areinstall-tui.test.mjsDeepSeek Harness Desktop cases that fail identically on unmodifiedmain(checked by stashing the branch). The added tests were also run againstmain'slib/: 4 of them fail there.Not run: a live hook invocation timing a real short prompt; the numbers in #7654 come from the reporter's measurement.
Checklist
Screenshots (if applicable)
Additional Notes
recallCompressSkipPrefixesfrom the issue is not included: the length threshold covers the reported cases, and a prefix list is a separate decision about which machine-sent prompts to treat as short.The change lands in
examples/memory-plugin-shared/lib, which every host packages, so all seven manifest entries move with it:0.7.27/0.11.25/0.5.36(with the paired agent-hook host manifests) /0.5.30/0.5.40/0.4.33/0.2.4.bash .github/scripts/check-plugin-version-bumps.sh origin/mainnow printsokfor all seven. #7645 bumps the first entry's manifests to0.7.27as well; whichever lands first owns that number and the other rebases onto the next one.The branch is merged up to
909ac00; the shared runtime copies were regenerated and the tracked tree stays clean.