fix: clear cross-run messaging-tool sent-text state after every compaction#80285
fix: clear cross-run messaging-tool sent-text state after every compaction#80285jetd1 wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 11:46 PM ET / 03:46 UTC. Summary PR surface: Source +10, Tests +4. Total +14 across 2 files. Reproducibility: yes. at source level but not as a live run in this review. Current main records messaging-tool sent text, uses the normalized array for duplicate suppression, and only clears those arrays during compaction retry reset, not after normal compaction. 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. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Port the cleanup to the current embedded-agent compaction lifecycle after retry delivery evidence is captured, add retry and non-retry regression coverage, and require redacted real behavior proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, at source level but not as a live run in this review. Current main records messaging-tool sent text, uses the normalized array for duplicate suppression, and only clears those arrays during compaction retry reset, not after normal compaction. Is this the best way to solve the issue? No. The cleanup idea is plausible, but the submitted branch targets removed Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +10, Tests +4. Total +14 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
|
1916451 to
7fd065c
Compare
…ction When a run completes and the session compacts, the arrays tracking texts sent via messaging tools (message(action=send), sessions_send, etc.) were only cleared on compaction retries (willRetry=true). On normal compaction (willRetry=false), stale entries survived into the next run, where isMessagingToolDuplicateNormalized() could false-positive on the new run's final reply text — silently dropping legitimate block replies. Clear messagingToolSentTexts, messagingToolSentTextsNormalized, messagingToolSentTargets, and messagingToolSentMediaUrls unconditionally at every compaction_end so the next run always starts with a clean slate. Co-Authored-By: Cha <[email protected]> via OpenClaw
|
This pull request has been automatically marked as stale due to inactivity. |
|
@jetd1 thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
Problem
When a run completes and the session compacts, the arrays tracking texts sent via messaging tools (
message(action=send),sessions_send, etc.) were only cleared on compaction retries (willRetry=true). On normal compaction (willRetry=false), stale entries survived into the next run.isMessagingToolDuplicateNormalized()compares the final reply text against these stale entries using substring matching (normalized.includes(normalizedSent)). If the new run's text happens to share a normalized substring with any entry from the previous run, the block reply is silently dropped with:Fix
Clear
messagingToolSentTexts,messagingToolSentTextsNormalized,messagingToolSentTargets, andmessagingToolSentMediaUrlsunconditionally in thecompaction_endhandler — before thewillRetrybranch — so the next run always starts with a clean slate.Verification
pi-embedded-subscribe.handlers.compaction.test.ts(updated fixture)emitBlockChunk,handleMessageEnd, or the dedup function itself — change is purely about state lifecycle between runs