Repository navigation
fix: stop compaction recovery when a run times out - #159105
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 7:27 PM ET / 23:27 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch carries session-queue cancellation into agent compaction recovery, adds regression and fixture coverage, and clarifies timeout behavior in the compaction guide. Merge readiness✅ Ready for maintainer review Keep open: current main and the latest release still have the queue-timeout recovery gap. This branch remains a viable repair, and GitHub now reports it as mergeable. Priority: P1 Review scores
Verification
How this fits togetherThe embedded agent runner receives turns from the session queue and may compact session history after a model attempt overflows. Queue cancellation must reach recovery before it retries or updates that history. flowchart LR
A[User turn] --> B[Session queue]
B --> C[Model attempt]
C --> D{Overflow?}
D -- Yes --> E[Compaction recovery]
E --> F[Session history and reply]
B -- Timeout --> G[Run cancellation]
G -- Stops --> E
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +493, Docs 0. Total +491 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the queue’s cancellation authority effective throughout recovery, while preserving the existing compaction watchdog and transcript-write guard. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main leaves recovery on the caller signal while queue expiry aborts the lane signal. The PR reports a failing pre-fix registered-runner case; this read-only review did not run it. Is this the best way to solve the issue? Yes. Binding the existing lane signal at run admission repairs the gap without adding a competing timeout policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aa8732e72f28. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
83aa3f6 to
d1d9fde
Compare
b57e2b1 to
e5afd75
Compare
e5afd75 to
dc76f2f
Compare
|
Merged via squash.
|
* fix: stop compaction recovery when a run times out * test: preserve compaction fixture method ownership * test: join failed channel startup before resetting fixtures * test: preserve publication custody through registry churn
What Problem This Solves
Fixes automatic compaction continuing after the session queue has timed out its run.
User Impact
Timed-out runs cancel active overflow and timeout recovery through the same signal as their model attempts. Existing timeout limits, compaction grace, and already-committed history are preserved.
Why This Change Was Made
Recovery inherited only the caller's cancellation signal, while queue expiry revoked a separate composed signal. Bind that composed signal once at run admission and remove the failover-only override. Direct attempt cancellation still notifies its specific reply operation after the lane owner verifies current authority; upstream cancellation retains its original reason.
CI also exposed fixture lifetime defects. The shared channel startup helper now observes its returned task, detects startup failure while awaiting readiness, and always aborts and joins failed checks. Google Chat uses a per-start readiness event and the same cleanup owner for restarts. The native Talk fixture now seals publication admission and joins every retained publication before disposing its projection, including when the model or a publication rejects. Exact-once, unregister, socket, and lifecycle assertions remain intact.
Evidence
The runtime diff is net −2 lines; additional changes are tests and existing test support. No schema, configuration, provider protocol, or timeout-policy change.
Main subsequently incorporated the same WhatsApp inbound-drain fix in 945ec9f, so its duplicate patch was dropped here. The existing Google Chat preload repair a3dcaa1 (credit Gabriel Bogdanovsky) is also retained; readiness and cleanup remain owned by the shared lifecycle helper.
An upstream Cron scheduler-fixture failure was resolved by refreshing onto existing main repair c0e6951. All three formerly failing Cron files pass (13 tests), along with both affected type graphs; this PR adds no Cron change.
The native Talk publication failure recurred in CI runs 36268149681 and 36273823971. A controlled real-worker reproduction then established that ordinary sibling registration could invalidate the first history-registry acquisition before a topology witness existed. Main already contained the owning repair in 3d90381, so this branch adopts it rather than adding a competing retry policy. The original failing CI operation's precise invalidator remains unobserved. This PR adds publication-boundary coverage and fixes rejected-publication fixture cleanup; the upstream repair retains the original state/source admission and permits only its documented metadata refresh budget.