Repository navigation
fix(tasks): skip completed deleted-agent stores - #130554
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 9:18 PM ET / August 27, 2026, 01:18 UTC. ClawSweeper reviewWhat this changesThe PR skips session stores for agents with completed deletion journals, reports those skips, and continues task maintenance for healthy stores. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The patch is a clean lifecycle-aware repair with no blocking correctness finding; it is a maintainer-owned PR and its exact-head CI is still running. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTask maintenance discovers configured and retained session stores, then prunes stale cron-run rows. Completed agent deletions intentionally fence their retained store identity, so this sweep must record that per-store outcome without hiding other stores' maintenance. flowchart LR
A[Tasks maintenance command] --> B[Discover session stores]
B --> C[Read deletion journal]
C --> D{Deletion complete?}
D -->|Yes| E[Record skipped retired store]
D -->|No| F[Prune eligible session rows]
E --> G[JSON and terminal summary]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +18, Tests +131. Total +149 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the completed-tombstone-only skip after exact-head CI, retaining explicit per-store reporting while leaving incomplete deletions and unrelated database failures terminal. Do we have a high-confidence way to reproduce the issue? Yes, by source: retain a deleted agent's store with a completed journal, then run task maintenance; current main opens every discovered store and hits the same-agent deletion fence. This read-only review did not execute the scenario. Is this the best way to solve the issue? Yes. The guard consumes the deletion lifecycle's authoritative completed state before the session-store open, and it preserves terminal handling for incomplete deletion and corruption rather than masking all open failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b13993af1554. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper rank-up moves:
No ClawSweeper code findings remain. |
|
Merged via squash.
|
Summary
Root cause
Aggregate task maintenance treated every discovered session store as openable. A completed agent deletion intentionally fences its retained database, so the loop threw after earlier healthy stores had already been maintained and never returned a report.
The deletion lifecycle owns that state. Maintenance now recognizes only a completed deletion tombstone as a per-store skip; every other database failure remains terminal.
Validation
tbx_01m10bk0ete6wtkx8sdvzawnnk: infrastructure blocked after roughly six hours without a terminal summary; the task-owned lease and processes were stopped, and no second heavy run was startedScope
The positive production delta is the explicit lifecycle-state result and aggregate reporting; no downstream fallback path was added.
This is user-visible and release-note worthy; the landing release workflow owns the changelog entry.
Fixes #130237
Reported by @andersonjeccel.