fix(compaction): skip replay-unsafe session sends#93293
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 10:30 PM ET / 02:30 UTC. Summary PR surface: Source +112, Tests +237. Total +349 across 2 files. Reproducibility: yes. at the source level, but not as a live timing repro in this review. Current main still falls back to unfiltered branch messages, Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this focused compaction fallback filter after refreshing the merge result and exact-head gates, while leaving the adjacent A2A reverse-send and message-tool mirror duplicate paths to their separate PRs. Do we have a high-confidence way to reproduce the issue? Yes at the source level, but not as a live timing repro in this review. Current main still falls back to unfiltered branch messages, Is this the best way to solve the issue? Yes. The compaction safeguard fallback is the narrow owner boundary for this bug because it is the point where current main reuses recovered branch messages for summarization; the related A2A API/delivery PRs address adjacent duplicate modes rather than this fallback replay. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b2cecd8ece47. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +112, Tests +237. Total +349 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3b641e9 to
9ca43f2
Compare
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
Co-authored-by: 杨浩宇0668001029 <[email protected]>
69fa892 to
e9dafd5
Compare
|
Merged via squash.
|
* fix(compaction): skip replay-unsafe session sends * fix(compaction): preserve safe text around session sends * fix(compaction): narrow replay filtering to sessions_send Co-authored-by: 杨浩宇0668001029 <[email protected]> * test(compaction): use review-safe key fixtures Co-authored-by: 杨浩宇0668001029 <[email protected]> * test(compaction): use placeholder API key Co-authored-by: 杨浩宇0668001029 <[email protected]> * test(compaction): limit fixture cleanup to new cases Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): preserve completed sessions_send history Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): preserve unfinished delegated work Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): detect completion before replay filtering Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): retain unresolved send status Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): preserve inert send outcomes Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): narrow terminal tail type Co-authored-by: 杨浩宇0668001029 <[email protected]> * fix(compaction): guard replay input lookup Co-authored-by: 杨浩宇0668001029 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
Fixes #84139.
Summary
sessions_sendtail from compaction branch fallback. Historical turns and unfinished turns ending in tool calls/results remain recoverable.sessions_sendcalls into inert summary text, preserving call IDs, arguments, returned results, failures, empty results, and missing-result state without leaving executable tool-call blocks to replay.Root cause
When normal compaction preparation contained no real conversation, the safeguard reused the session branch verbatim. That could replay an already-delivered target-side inter-session turn or an already-executed source-side
sessions_sendcall. The previous candidate filter was too broad: it also removed historical and unfinished work.The repaired patch stays at the compaction fallback owner boundary. It drops a target-side turn only when the original branch ends in terminal assistant text. Source-side send calls/results become inert evidence instead of executable tool history.
Compatibility and scope
CHANGELOG.mdremains release-owned; this PR body carries release-note context.Merge risk
merge-risk: session-state: over-filtering could lose recovery context.merge-risk: message-delivery: under-filtering could replay a side effect.The focused tests cover completed target turns, historical target turns, ordinary and nested unfinished tool work, resolved/failed/missing source-side sends, namespaced tool names, and normal fallback preservation.
Proof
Rebased current head:
e9dafd53382c7abc45d285dddf98d882abf85f33Blacksmith Testbox run: https://github.com/openclaw/openclaw/actions/runs/29480862149
Behavior verification remains source-level and focused rather than a live timing capture across two running agents. The linked intermittent path is therefore partially, not fully, reproduced end to end.
Contributor credit
Original fix and regression direction by @mushuiyu886. Maintainer repair commits retain
Co-authored-by: 杨浩宇0668001029 <[email protected]>.