Repository navigation
fix(tasks): retain live blocked task flows during maintenance - #117606
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:58 PM ET / 19:58 UTC. ClawSweeper reviewWhat this changesThis PR prevents TaskFlow maintenance from pruning blocked flows that are still live because they have no Merge readinessKeep this PR open for normal owner review and landing: current Priority: P1 Review scores
Verification
How this fits togetherTaskFlow records are durable shared-SQLite state for managed and task-mirrored work. Registry maintenance reconciles cancellation state and removes old terminal records, while the audit surface reports stale live flows for operators to inspect. flowchart TD
A[Managed controller] --> B[Durable TaskFlow record]
B --> C[Blocked flow state]
C --> D{Has end timestamp?}
D -->|No: still live| E[Retain record and show stale audit]
D -->|Yes: terminal| F[Seven-day maintenance retention]
F --> G[Prune completed record]
E --> H[Resume or cancel reconciliation]
Decision needed
Why: The patch is source-consistent and has concrete before/after SQLite evidence, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +110. Total +110 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the narrowly scoped maintenance-owner correction once normal maintainer review and the remaining required checks confirm the current head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: Is this the best way to solve the issue? Yes. Changing the terminal classification at the maintenance owner is the narrowest coherent fix because both pruning and cancellation reconciliation already flow through that predicate, while ended blocked records keep their existing retention behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 182be0f7c176. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The shipped
v2026.7.2-beta.6TaskFlow maintenance owner classifies everyblockedflow as terminal, even when a managed controller intentionally persistsendedAt: nullwhile waiting for approval or another external event. After seven days, preview reports that live flow as prunable and applying maintenance permanently deletes its durable row from the shared SQLite database; cancel-requested blocked flows also fail to reconcile.Why This Change Was Made
Fix the classification at its existing maintenance owner:
blockedis terminal only when the flow actually has an end timestamp. The single production-line replacement preserves the existing seven-day retention behavior for genuinely ended managed and mirrored blocked flows, while keeping waiting/approval state, audit visibility, and cancellation reconciliation coherent. Production LOC delta: zero.User Impact
Long-lived approval gates and resumable external workflows survive task maintenance and Gateway restarts instead of silently disappearing. Operators can still prune completed blocked flows, observe stale live blocks, and cancel blocked managed work once its child tasks have settled. No configuration, schema, migration, plugin API, or cron behavior changes.
Evidence
4584e47e3960418b1d254b628afb36a2c64c074c; tree:26ed08571444268c0cced3600b203e867f26c1e9; direct parent:c263c273c75008ed3d3e0788ffc8373726802ce4.src/tasks/task-flow-registry.maintenance.tsandsrc/tasks/task-flow-registry.maintenance.test.ts.v2026.7.2-beta.6.oxlintand targetedoxfmt --check: clean.codex, modelgpt-5.6-sol, reasoninghigh,--max-priority P3; TruffleHog clean; exit 0; no accepted or actionable findings.