Repository navigation
Conversation
If CLI compaction summarization fails after the assistant reply is already generated and persisted, the error should not discard the reply or surface the turn as a failure. Wrap compaction in try/catch so network errors from the summarizer don't kill the turn. (openclaw#94688)
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the reported bug is real, but this branch catches post-turn compaction failures too broadly and the same work is already covered by a safer open canonical PR with a deliverable-output gate and focused regression coverage. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #94928 as the canonical fix and close overlapping branches after maintainers land or reject that path. So I’m closing this here and keeping the remaining discussion on #94928. Review detailsBest possible solution: Use #94928 as the canonical fix and close overlapping branches after maintainers land or reject that path. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main persists the CLI transcript, then awaits post-turn compaction before final delivery durability and Is this the best way to solve the issue? No. This PR is a plausible mitigation, but the best fix is the reply-gated lifecycle-owner path in #94928 because it keeps no-reply compaction failures fatal and adds focused regression coverage. Security review: Security review cleared: The diff only changes agent runtime error handling and does not touch dependencies, workflows, secrets, permissions, package metadata, generated code, or install/build scripts. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
Fixes #94688
Summary
When CLI compaction summarization fails after the assistant reply is already generated and persisted, the error was surfaced as a turn failure — discarding the already-generated reply. Wrap compaction in try/catch so network errors from the summarizer don't kill the turn.
Root Cause
agentCommandInternalruns post-turn compaction (a summarization call) after the reply is already persisted. If that call fails with a network error, the await throws, the error propagates up, and the successful reply is treated as a failure.Changes
src/agents/agent-command.ts: Wrap compaction lifecycle call in try/catchReal behavior proof
Behavior addressed: Post-turn compaction failures no longer discard already-generated replies.
Evidence after fix:
Note: The compaction runtime (
runCliTurnCompactionLifecycle) requires a full agent session environment (session manager, model calls, config) and cannot be invoked standalone. The try/catch pattern is verified by the actual module structure:Risk
Closes: #94688