Repository navigation
fix(agents): keep not_required delivery status when completion_announced_at exists - #108710
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 3:17 AM ET / 07:17 UTC. Summary PR surface: Source +2, Tests +35. Total +37 across 2 files. Reproducibility: yes. from source, but not as a live run: current main unconditionally applies Review metrics: 1 noteworthy metric.
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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the narrow hydration rule and regression tests, then demonstrate a real gateway restart that reloads a non-delivery subagent row as Do we have a high-confidence way to reproduce the issue? Yes from source, but not as a live run: current main unconditionally applies Is this the best way to solve the issue? Yes, provisionally: conditioning the typed-column override on whether completion delivery is expected is the narrowest fix and aligns hydration with the existing delivery-state invariant; live restart proof remains required. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f9e7a4cab8f0. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2, Tests +35. Total +37 across 2 files. View PR surface stats
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
|
66c6d37 to
8bd8fa9
Compare
|
Maintainer repair and verification complete at
Best-fix check: typed SQLite columns are the canonical persistence source, the final override repairs both clean and contradictory upgrade rows, and no runtime compatibility path or sibling delivery-state change is needed. |
…ced_at exists for expectsCompletionMessage=false runs createDeliveryFromTypedColumns unconditionally overrode status to 'delivered' when completion_announced_at was present, even for runs where expects_completion_message is false. This produced a contradictory delivery state where a run that does not require completion delivery was marked as delivered. Only set status to 'delivered' when expects_completion_message is true. For not_required runs that still have completion_announced_at recorded (for informational purposes), preserve announcedAt without overriding the status.
8bd8fa9 to
8ee4445
Compare
|
Final post-rebase verification complete at
Best-fix check: typed SQLite columns are the canonical persistence source, the final override repairs both clean and contradictory upgrade rows, and no runtime compatibility path or sibling delivery-state change is needed. |
|
Merged via squash.
|
…ced_at exists (openclaw#108710) * fix(agents): keep not_required delivery status when completion_announced_at exists for expectsCompletionMessage=false runs createDeliveryFromTypedColumns unconditionally overrode status to 'delivered' when completion_announced_at was present, even for runs where expects_completion_message is false. This produced a contradictory delivery state where a run that does not require completion delivery was marked as delivered. Only set status to 'delivered' when expects_completion_message is true. For not_required runs that still have completion_announced_at recorded (for informational purposes), preserve announcedAt without overriding the status. * test(agents): cover tainted delivery rows --------- Co-authored-by: Peter Steinberger <[email protected]>
…ced_at exists (openclaw#108710) * fix(agents): keep not_required delivery status when completion_announced_at exists for expectsCompletionMessage=false runs createDeliveryFromTypedColumns unconditionally overrode status to 'delivered' when completion_announced_at was present, even for runs where expects_completion_message is false. This produced a contradictory delivery state where a run that does not require completion delivery was marked as delivered. Only set status to 'delivered' when expects_completion_message is true. For not_required runs that still have completion_announced_at recorded (for informational purposes), preserve announcedAt without overriding the status. * test(agents): cover tainted delivery rows --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
createDeliveryFromTypedColumnsinsubagent-registry.store.sqlite.tsunconditionally overrode deliverystatusto"delivered"whenevercompletion_announced_atwas present, even for runs whereexpectsCompletionMessageisfalse. This produced a contradictory delivery state: a run that does not require completion delivery was marked as delivered.Why This Change Was Made
When restoring subagent run records from SQLite typed columns, the hydration at lines 92-98 spread
status: "delivered"whenevercompletion_announced_at !== null, without checking whether the run actually requires completion delivery. ForexpectsCompletionMessage === falseruns, the correct status is"not_required"— thecompletion_announced_attimestamp may exist for informational logging but should not override delivery semantics.This contradicts the normalization logic in
buildDeliveryState(subagent-delivery-state.ts:238) which correctly returns{ status: "not_required" }whenexpectsCompletionMessage === false, bypassing all delivery state checks.User Impact
Subagent runs with
expectsCompletionMessage === falsethat have their completion timestamp recorded would get incorrectstatus: "delivered"after gateway restart (which reloads from SQLite). Downstream delivery logic checkingstatus === "delivered"could attempt unnecessary delivery retries for runs that should be dormant.Evidence
createDeliveryFromTypedColumnsatsrc/agents/subagent-registry.store.sqlite.ts:92-98unconditionally spreadsstatus: "delivered"based oncompletion_announced_at.buildDeliveryStateatsrc/agents/subagent-delivery-state.ts:238-239correctly returns{ status: "not_required" }for the same scenario.not_requiredstatus is preserved andannouncedAtis kept for informational purposes.Real behavior proof
proof: test — SQLite round-trip tests directly assert delivery status after save+load. Local execution blocked by Node 22.22.0 SQLite WAL version gate; CI validates.