fix(openclaw-plugin): default recall to assemble and bound afterTurn#1424
fix(openclaw-plugin): default recall to assemble and bound afterTurn#14240xble wants to merge 19 commits intovolcengine:mainfrom
Conversation
Move the OpenClaw plugin to an assemble-first recall path when the context-engine slot is active, keep before_prompt_build as compatibility-only behavior, and teach the setup helper to resolve the active OpenClaw config file so json5-based installs upgrade cleanly.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
“这些 logger.info 现在会在非 debug 模式下输出 session context / summary / message preview,默认日志会带上用户内容。建议收敛到 logFindRequests/debug 开关后,或只保留计数与 trace_id 等非内容信息。” 代码有confilict |
…le-recall # Conflicts: # examples/openclaw-plugin/context-engine.ts
|
Kept the ingest-reply-assist fallback even when recall init fails, pushed the conflict resolution, and tightened the noisy session-content logs so full summaries/message previews stay behind debug logging. |
|
Did one simplify pass on the current branch head. This only removes a duplicated |
|
I found one functional regression in the new
I reproduced this locally with a focused
The stored OV session contained:
Then
instead of reconstructing the original tool-use / tool-result pair. Impact: once a session is restored from OV, agents can lose the actual tool invocation/result history they may need for continuity, debugging, or follow-up decisions. I’d recommend either:
and adding a dedicated round-trip test that exercises For context, I also ran the current plugin test suite locally ( |
…le-recall # Conflicts: # examples/openclaw-plugin/context-engine.ts
- Add `RECALL_PATHS` / `RecallPath` in config.ts and use them everywhere `"assemble"` / `"hook"` string literals appeared (context-engine, index, setup-helper install). `DEFAULT_RECALL_PATH` now references `RECALL_PATHS.assemble`, and the validation in `parse()` does the same, so adding a new path requires only one edit. - Explain why `AFTER_TURN_MAX_TIMEOUT_MS` is capped at 5s and floored at 1s, instead of leaving a bare magic number. - Translate the Chinese inline comment in context-engine.ts to English so the reason we don't flatten tool-use/tool-result into assistant text is readable by the full team.
Closes the coverage gap Mijamind719 flagged on this PR. The test drives the real engine.afterTurn() against a mocked OV client, captures the messages that would be persisted (in OV's snake_case shape), then feeds them back through convertToAgentMessages() and mergeConsecutiveAssistants() to verify an assistant(text + toolUse) + toolResult pair survives the capture -> store -> rehydrate path. This guards against the shim in afterTurn drifting out of sync with the camelCase format extractNewTurnMessages emits, which was the specific regression the maintainer observed.
|
@Mijamind719 — Added the dedicated afterTurn -> assemble round-trip test you suggested. It exercises the real Still need to resolve the |
…#1564) Upstream removed the ingestReplyAssist feature entirely in volcengine#1564 (config keys, schema, docs, and their tests). Accept those deletions; the branch's remaining call sites and recall-context.ts helpers will be stripped in the follow-up commit so the tree compiles again. Resolution notes: - README.md: drop the 'Transcript ingest assist' subsection (upstream deleted the corresponding docs block). - All other files auto-merged cleanly.
Complete the alignment with upstream volcengine#1564's removal of the ingestReplyAssist feature. The merge commit accepted upstream's deletions on its side; this commit removes the remaining call sites and helpers Brian's branch still carried so the tree compiles: - recall-context.ts: drop buildIngestReplyAssistSection; it referenced cfg.ingestReplyAssist* fields that no longer exist in the config schema and isTranscriptLikeIngest that upstream removed. - context-engine.ts / index.ts: drop the call sites that added the ingest-assist prompt section; the system prompt now composes from recall + archive sections only. - config.ts: remove ingestReplyAssist* from allowed-key validation and drop the deprecated-alias fallback for bypassSessionPatterns. - openclaw.plugin.json: drop form schema for the removed config keys. - tests: drop the hook-fallback test that exercised the dead path and the deprecated-alias test in bypass-session-patterns. The assemble-recall behavior this PR is really about (recallPath default = assemble, bounded afterTurn, tool round-trip) is unchanged. All 341 vitest tests pass locally.
Thanks for your contribution |
Description
Default the OpenClaw plugin to an assemble-first recall path when OpenViking
owns the
contextEngineslot, and fail open if the plugin's hot-path capturework gets slow.
This avoids running hook-based recall and context-engine recall on the same
reply path, updates the setup helper to resolve the active OpenClaw config
file so existing installs upgrade cleanly, and bounds
afterTurnauto-captureso slow OV writes do not keep an OpenClaw run open after the model already
replied. It also keeps default plugin logs content-safe: session summaries,
message previews, and captured turn text are only emitted when debug routing
logs are enabled.
Related Issue
Related to #1283
Type of Change
Changes Made
assemble()by default and added arecallPathconfig so
before_prompt_buildonly runs in explicit compatibility mode.recallPath=assemble, disable prompt injection in context-engine mode, andresolve the active OpenClaw config file instead of assuming
openclaw.json.afterTurnauto-capture with a fail-open timeout so slow OpenVikingsession writes cannot block OpenClaw run completion after the assistant has
already produced a reply.
logFindRequestsand keptdefault info logs to non-content metadata such as counts, status, task, and
trace IDs.
initialization fails, so a recall outage does not suppress the non-client
prompt assist path.
setup-helper config handling, content-safe default logging, recall init
fallback, and
afterTurntimeout fallback behavior.Testing
Commands run:
npm exec --package typescript -- tsc --noEmitnpm test -- tests/ut/local-startup-failure.test.ts tests/ut/plugin-bypass-session-patterns.test.ts tests/ut/context-engine-assemble.test.tsnpm testgit diff --checkcr review --type committed --base upstream/main --agentChecklist
Screenshots (if applicable)
N/A
Additional Notes
OpenViking plugin at v0.3.5.
gateway-timeout fallback behavior.
maininto the PR branch to resolve the reportedconflict.