fix(agents): preserve compaction summary extra params#75085
Conversation
|
Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw. Close: the reported compaction-summary payload gap is a useful bug direction, but this branch is no longer a viable landing candidate because it targets removed Pi runtime paths, adds an obsolete root dependency patch, is conflicting, and lacks real behavior proof. So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome. Review detailsBest possible solution: Close this stale branch and take the useful idea into a fresh narrow PR against the current agent-core/session compaction Do we have a high-confidence way to reproduce the issue? Yes from source inspection, but not from a live run. Current main applies OpenAI-compatible extra params on normal stream paths, while safeguard summary calls still do not carry the same resolved stream/payload context. Is this the best way to solve the issue? No. The behavior direction is useful, but the submitted fix is now the wrong layer because current main has a local agent-core Security review: Security review needs attention: Security review needs attention because the diff adds a root patched dependency and lockfile patch hash that now appear unnecessary on current main.
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 462c076a24e2. |
d0d14c0 to
78230e9
Compare
78230e9 to
58d90ee
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
chat_template_kwargsand supportedextra_bodyfields, when safeguard compaction generates built-in LLM summaries.@mariozechner/pi-coding-agentpatch sogenerateSummary()can receive an optionalonPayloadhook without changing default behavior.Root Cause
The normal assistant stream path already patched OpenAI-compatible request bodies, but the compaction summary fallback called
generateSummary()directly. That dependency function forced summary completion setup internally and exposed no request payload hook, so vLLM params such as:{ "chat_template_kwargs": { "enable_thinking": false, "preserve_thinking": true } }never reached summary requests during compaction.
Tests
pnpm test src/agents/compaction.summarize-fallback.test.tspnpm test src/agents/pi-hooks/compaction-safeguard.test.tspnpm test src/agents/pi-embedded-runner-extraparams.test.tspnpm checkpnpm build