Repository navigation
fix(tasks): throttle unchanged attempt activity - #155745
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 22, 2026, 10:47 AM ET / 14:47 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR suppresses redundant task activity writes, adds persistence regressions, synchronizes a memory repair fixture, and redistributes Gateway typecheck coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. No introduced correctness or security defects were found; the previous review’s empty finding list remains appropriate. Priority: P2 Review scores
Verification
How this fits togetherThe task registry receives agent lifecycle and tool events and maintains durable task status. Its shared reducer determines whether queued activity needs a SQLite write and subsequent publication. flowchart TD
A[Agent lifecycle and tool events] --> B[Task event queue]
B --> C[Combine pending updates]
C --> D[Compare with current task row]
D --> E{Changed facts or heartbeat due?}
E -->|Yes| F[Persist and publish task]
E -->|No| G[Settle without writing]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +319, Docs 0. Total +318 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep timestamp normalization in the shared reducer so worker and synchronous consumers enforce the same heartbeat while preserving real transitions. Do we have a high-confidence way to reproduce the issue? Yes, from source: a recent finishing event with an omitted or equal start timestamp produces a nonempty patch on current main and bypasses the documented throttle. This review did not execute tests. Is this the best way to solve the issue? Yes. Comparing after coalescing against the authoritative row repairs the existing owner without losing queued corrections or introducing a competing cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 50ea1795fc80. 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
History |
|
Merged via squash auto-merge.
|
Include the canonical memory candidate fixture repair from #155745. Preserve the reviewed five-file diagnostic change exactly.
* fix(sessions): stop repeated failed worker exit cleanup Use one-shot process-exit cleanup for retained reclamation workers and the canonical validation pool. A rejected asynchronous close previously kept its beforeExit listener, so each drained event loop repeated the same cleanup and could prevent CLI and QA commands from exiting. Keep failed database resource ownership and explicit close retries intact. The existing native-worker tests cover failed idle memory-pressure cleanup, repeated pressure, one exit cleanup attempt, and explicit receipt recovery. Exit simulations dispatch only still-registered handlers. Validation: 51 focused worker tests pass on current main, including pressure and custody composition. Both exit-event regressions fail with the original listeners. Independent autoreview found no actionable issues. * fix(sessions): preserve recovery when stopping repeated exit cleanup * fix(sessions): reconcile exit cleanup with current main Preserve one-shot automatic SQLite exit cleanup and explicit recovery of retained worker custody. Include the reviewed checkout fixture single post-handler publication and current main's canonical archive-placement repair from #155751. * test(ci): integrate canonical fixture repairs Merge current main with the memory candidate synchronization fix from #155745 and archive lifecycle request settlement from 94b9c47. Preserve the reviewed six-file SQLite exit cleanup and checkout fixture delta without further source changes. Co-authored-by: Peter Steinberger <[email protected]>
* fix(cli): avoid readiness waits for absent Gateways Local-only agent environments should report an unavailable Gateway promptly instead of spending the full startup budget. Let diagnostics use the existing readiness owner to confirm that the selected service, port listener, current lease, and validated legacy lock are absent. Preserve native and foreground startup grace, published lock-based Gateway ownership, inspection and cleanup errors, and replacement handoffs. Start, restart, and updater callers retain their existing wait policy. * fix(cli): report confirmed Gateway absence promptly Use native service absence and runtime facts before taking the diagnostic-only missing-service path. Preserve unknown managers, current and legacy Gateway owners, selected-target matching, and shared deadline and cleanup behavior. * test(cli): expose swallowed late cleanup errors Reject the late legacy-owner lookup once so a later lookup cannot hide the loss of the original cleanup error. * chore: refresh Gateway diagnostic readiness on main Include the canonical memory candidate fixture repair from #155745. Preserve the reviewed five-file diagnostic change exactly. * fix(cli): preserve startup handoff within diagnostic deadlines Consult the canonical startup migration lease before reporting a missing Gateway, and retain observed migration activity across the lease-to-owner handoff for this readiness wait. Use the shared deadline owner for numeric diagnostic budgets, returning the last diagnostic snapshot only for its own expiry while joining process cleanup. Keep lifecycle callers on their existing throwing policy. The four new entry-point regressions fail on the prior public code. The strengthened migration handoff also fails on the first repair. The final candidate passes 353 focused cases, and independent P2 review is clean. The complete selected 31-check gate passed, including all 25 test type graphs. * fix(cli): preserve migration grace for missing service units Keep missing-service diagnostics on the authoritative absence decision through all stopped/free observations. Native stopped/missing-unit snapshots retain migration and legacy-owner uncertainty until the diagnostic deadline. Extend the adapter cases beyond the generic early-exit threshold and preserve the default lifecycle missing-unit timing. The three strengthened rows fail on the previous public head at 12.5 seconds. Qualified 355 distinct cases pass, along with all 31 selected checks and 25 test type graphs. The lifecycle fixture uses the real service interface, and fresh independent P2 review is clean. * fix(cli): carry diagnostic deadlines through native inspection * chore: refresh Gateway diagnostic readiness on canonical main Preserve the complete fc6487d readiness and native-deadline patch while integrating canonical backup recovery and CI export repairs. The candidate passes 254 focused tests, selected type/lint checks, and independent P2 review. Original ordered timeout reproduction remains unrun because its matching resource capacity is unavailable. Co-authored-by: Peter Steinberger <[email protected]>
* fix(tasks): throttle unchanged attempt activity * test(tasks): keep fence checkpoint executor void * test(memory): synchronize candidate repair worker completion * test(ci): restore gateway typecheck headroom
) * fix(sessions): stop repeated failed worker exit cleanup Use one-shot process-exit cleanup for retained reclamation workers and the canonical validation pool. A rejected asynchronous close previously kept its beforeExit listener, so each drained event loop repeated the same cleanup and could prevent CLI and QA commands from exiting. Keep failed database resource ownership and explicit close retries intact. The existing native-worker tests cover failed idle memory-pressure cleanup, repeated pressure, one exit cleanup attempt, and explicit receipt recovery. Exit simulations dispatch only still-registered handlers. Validation: 51 focused worker tests pass on current main, including pressure and custody composition. Both exit-event regressions fail with the original listeners. Independent autoreview found no actionable issues. * fix(sessions): preserve recovery when stopping repeated exit cleanup * fix(sessions): reconcile exit cleanup with current main Preserve one-shot automatic SQLite exit cleanup and explicit recovery of retained worker custody. Include the reviewed checkout fixture single post-handler publication and current main's canonical archive-placement repair from openclaw#155751. * test(ci): integrate canonical fixture repairs Merge current main with the memory candidate synchronization fix from openclaw#155745 and archive lifecycle request settlement from 5f027d8. Preserve the reviewed six-file SQLite exit cleanup and checkout fixture delta without further source changes. Co-authored-by: Peter Steinberger <[email protected]>
) * fix(cli): avoid readiness waits for absent Gateways Local-only agent environments should report an unavailable Gateway promptly instead of spending the full startup budget. Let diagnostics use the existing readiness owner to confirm that the selected service, port listener, current lease, and validated legacy lock are absent. Preserve native and foreground startup grace, published lock-based Gateway ownership, inspection and cleanup errors, and replacement handoffs. Start, restart, and updater callers retain their existing wait policy. * fix(cli): report confirmed Gateway absence promptly Use native service absence and runtime facts before taking the diagnostic-only missing-service path. Preserve unknown managers, current and legacy Gateway owners, selected-target matching, and shared deadline and cleanup behavior. * test(cli): expose swallowed late cleanup errors Reject the late legacy-owner lookup once so a later lookup cannot hide the loss of the original cleanup error. * chore: refresh Gateway diagnostic readiness on main Include the canonical memory candidate fixture repair from openclaw#155745. Preserve the reviewed five-file diagnostic change exactly. * fix(cli): preserve startup handoff within diagnostic deadlines Consult the canonical startup migration lease before reporting a missing Gateway, and retain observed migration activity across the lease-to-owner handoff for this readiness wait. Use the shared deadline owner for numeric diagnostic budgets, returning the last diagnostic snapshot only for its own expiry while joining process cleanup. Keep lifecycle callers on their existing throwing policy. The four new entry-point regressions fail on the prior public code. The strengthened migration handoff also fails on the first repair. The final candidate passes 353 focused cases, and independent P2 review is clean. The complete selected 31-check gate passed, including all 25 test type graphs. * fix(cli): preserve migration grace for missing service units Keep missing-service diagnostics on the authoritative absence decision through all stopped/free observations. Native stopped/missing-unit snapshots retain migration and legacy-owner uncertainty until the diagnostic deadline. Extend the adapter cases beyond the generic early-exit threshold and preserve the default lifecycle missing-unit timing. The three strengthened rows fail on the previous public head at 12.5 seconds. Qualified 355 distinct cases pass, along with all 31 selected checks and 25 test type graphs. The lifecycle fixture uses the real service interface, and fresh independent P2 review is clean. * fix(cli): carry diagnostic deadlines through native inspection * chore: refresh Gateway diagnostic readiness on canonical main Preserve the complete fc6487d readiness and native-deadline patch while integrating canonical backup recovery and CI export repairs. The candidate passes 254 focused tests, selected type/lint checks, and independent P2 review. Original ordered timeout reproduction remains unrun because its matching resource capacity is unavailable. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Finishing an agent attempt can write unchanged task metadata immediately, bypassing the documented one-minute throttle for activity-only updates.
User Impact
Tasks retain the existing activity heartbeat without redundant writes between real transitions. Changed timestamps, starts, errors, tools, and terminal outcomes still persist immediately. No configuration or migration is required.
Release-note context: avoid unnecessary task-state writes when an attempt reports unchanged activity.
Why This Change Was Made
The shared event reducer previously copied the existing start timestamp into otherwise empty lifecycle updates. Remove that synthetic fact and discard equal timestamps only after coalescing and an authoritative row read. Both Worker writes and synchronous consumption retain queued timestamp corrections. Production code is one line smaller; no cache or phase-specific filter is added.
A separate test-only commit repairs the memory candidate fixture that blocked both CI attempts after candidate reads moved to a Worker. It replaces elapsed-time polling with the existing retrieval queue and provider-entry signals. The fixture keeps its existing timeout and real repair gate; native cancellation releases the gate. Memory production code is unchanged.
A second test-only commit restores typecheck headroom after a new test on main pushed
gateway-serverto 701 roots. It moves the complete worker-environment test subtree into the existinggateway-othergraph and updates ownership assertions and documentation. The 25 graphs, stripe assignments, compiler concurrency, 700-root headroom guard, and 720-root hard cap stay unchanged.Evidence
node scripts/run-vitest.mjs src/tasks/task-registry-agent-events.liveness.test.tspassed 13 cases in 44.38 seconds through the repository wrapper (37.89 seconds in Vitest), using the existing compiled-worker cache. Those test bytes are unchanged. CI per-file time cannot be attributed from the available compact-job metadata; no whole-job duration is presented as this file's cost. This addresses the review's test-cost request using the prescribed local wrapper.092cc29d5e0a9da56c507e567a6a5edaedf3be4dreproduces 701 Gateway server roots. The paired allocation change gives 479 server / 318 other roots with every canonical root assigned once across all 25 graphs. The branch itself has 478 / 318 roots.414782450952a196bbb64b1605a458c2531c47b6, includingcodex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:188–206,codex-rs/app-server-protocol/src/protocol/v2/turn.rs:377–394, andcodex-rs/app-server/src/bespoke_event_handling.rs:1523–1573.This proves durable-write suppression and preserved lifecycle behavior. It does not claim a measured CPU or latency improvement.