Repository navigation
fix(agent): keep replies deliverable when compaction fails - #94854
extrasmall0 wants to merge 4 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this PR targets a real post-turn compaction delivery bug, but #94928 is the safer open canonical landing path and this branch's custom text-only deliverability gate misses non-text replies. Canonical path: Land #94928 or an equivalent shared outbound-payload-gated lifecycle fix, then close the overlapping compaction-failure PRs after one canonical fix merges. So I’m closing this here and keeping the remaining discussion on #94928. Review detailsBest possible solution: Land #94928 or an equivalent shared outbound-payload-gated lifecycle fix, then close the overlapping compaction-failure PRs after one canonical fix merges. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: persist a CLI reply transcript, make Is this the best way to solve the issue? No. A lifecycle-owner exception is the right layer, but this branch is not the best fix because it reimplements deliverability as a text-only predicate instead of using the shared outbound payload projection used by #94928. Security review: Security review cleared: The diff only changes agent runtime error handling and focused tests; it does not touch dependencies, workflows, secrets, permissions, package metadata, or code download/execution surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47. |
|
Addressed the test-types failure in 64c2950. The test helper now gives the CLI payload fixtures an explicit payload shape, so the empty-result fixture no longer narrows Validation: |
Summary
Real behavior proof
Behavior or issue addressed: A CLI-backed turn can persist the assistant reply and then hit a post-turn compaction error. After this patch, that compaction error is logged and delivery still runs instead of surfacing the whole turn as unavailable.
Real environment tested: Local OpenClaw checkout on macOS arm64 with Node v24.13.0, using the patched
agent-command.tsand focused agent command test shard.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/agent-command.live-model-switch.test.ts --maxWorkers=1Evidence after fix: Terminal capture from the local OpenClaw checkout after applying this patch:
Observed result after fix: The focused shard includes the new post-success compaction failure case. It confirms the CLI transcript is persisted, compaction throws
Summarization failed: Connection error,deliverAgentCommandResultstill runs once, and the lifecycle reachesendinstead of rethrowing the compaction error.What was not tested: I did not stage a live provider/network failure that forces Codex compaction to fail on demand; this proof uses the existing agent command harness to force that post-persistence failure path deterministically.
Testing
node scripts/run-vitest.mjs src/agents/agent-command.live-model-switch.test.ts --maxWorkers=1Fixes #94688