Recover stale pending final deliveries#90855
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 1:10 PM ET / 17:10 UTC. Summary PR surface: Source +330, Tests +528. Total +858 across 18 files. Reproducibility: yes. source-level. The PR head rewrites Slack user-scoped pending contexts when current user proof is absent and sends cached pending-final text after route matching without a created-at or attempt-count gate. Review metrics: 2 noteworthy metrics.
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:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Rebase onto current main, require matched Slack user proof before DM target rewriting, add a freshness or attempt gate before cached replay, keep heartbeat light-context default behavior explicit, and refresh current-head real behavior proof. Do we have a high-confidence way to reproduce the issue? Yes, source-level. The PR head rewrites Slack user-scoped pending contexts when current user proof is absent and sends cached pending-final text after route matching without a created-at or attempt-count gate. Is this the best way to solve the issue? No, not as submitted. Same-route replay is a plausible mitigation, but the best fix needs stricter route proof, stale-state bounds, conflict resolution, and refreshed current-head proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f284ce3b4df7. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +330, Tests +528. Total +858 across 18 files. View PR surface stats
Security concerns:
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
Review history (1 earlier review cycle)
|
53175f7 to
2f36319
Compare
2f36319 to
b1e6a3d
Compare
b1e6a3d to
4ff5e4d
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
lightContext: falseReal behavior proof
pendingFinalDelivery=truecan now safely replay that pending final on the same route instead of staying stuck; huge heartbeat sessions now switch to lightweight bootstrap context to avoid another compaction/context spiral.4ff5e4d2cb24f936f84fd868be70e4c53e2629ea; before-state was confirmed read-only from the Contabo/OpenClaw production session/log store for the June 5 incident.git rev-parse HEAD;git diff --check origin/main...HEAD;node scripts/test-projects.mjs src/auto-reply/reply/pending-final-delivery.test.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts src/logging/diagnostic-session-attention.test.ts src/infra/heartbeat-runner.model-override.test.ts -- --reporter=verbose;pnpm check:test-types;pnpm build.agent:main:slack:direct:u039p2yjr29still hadpendingFinalDelivery=trueafter generated final output, while themc-gateway...:mainlane had an estimated2,530,988prompt tokens against a1,000,000budget and priorcontext_length_exceededduring compaction.Tests and validation
Which commands did you run?
git diff --check origin/main...HEADnode scripts/test-projects.mjs src/auto-reply/reply/pending-final-delivery.test.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts src/logging/diagnostic-session-attention.test.ts src/infra/heartbeat-runner.model-override.test.ts -- --reporter=verbosepnpm check:test-typespnpm buildWhat regression coverage was added or updated?
What failed before this fix, if known?
check-test-typesinitially failed because the shared heartbeat test fixture type did not include the newly seededtotalTokensfields. Fixed in this head.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. A stalled pending final can now be replayed to the exact same route before new model work.
Did config, environment, or migration behavior change? (
Yes/No)No config/env/migration shape change. Heartbeat runtime now auto-selects lightweight bootstrap context for huge sessions unless explicitly disabled.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No auth/secrets/tool execution change. Network/send behavior changes only for same-route pending final replay after existing send-policy and suppression checks.
What is the highest-risk area?
Duplicate or wrong-route final delivery.
How is that risk mitigated?
Replay is gated by exact channel/target/account/thread context matching, send-policy/suppression checks, sanitized non-empty text, and pending state is cleared only after a successful final dispatch.