Repository navigation
fix(tasks): scope ACP completion notices to execution instances - #159173
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, 5:06 PM ET / 21:06 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch uses each ACP execution’s stored instance ID when choosing completion-notice peers, adds regression coverage, and clarifies the tasks guide. Merge readiness✅ Ready for maintainer review Current main still suppresses a later ACP execution’s completion notice when it reuses a request ID. The branch addresses that distinct execution and preserves duplicate suppression for the same execution; no actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherACP executions create task records that the task registry finalizes. Terminal delivery then chooses whether to send a completion notice directly or queue it for the requester’s session. flowchart LR
A[ACP execution] --> B[Task record]
B --> C[Terminal result]
C --> D[Choose notification peers]
D --> E{Same execution?}
E -->|Yes| F[One completion notice]
E -->|No| G[Separate completion notices]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +23, Docs 0. Total +30 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep notification deduplication in the task delivery owner, keyed to an ACP execution where its backing identity is available, while retaining legacy-record behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the peer-selection collision, and the PR reports a manager regression that fails before the fix and passes after it; this read-only review did not execute the test. Is this the best way to solve the issue? Yes. The change narrows the existing delivery selector using identity already stored by ACP task creation, with controls for same-instance and legacy duplicates. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b4ed0cc7abed. 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 (1 earlier review cycle)
|
Distinct ACP executions can share a requester, child session, and request ID while retaining separate task and flow IDs. Include the persisted ACP instance ID in notification peer selection so an older execution cannot suppress the next completion. Preserve deduplication for same-instance projections and legacy records, and document the notification contract. On Blacksmith Testbox, the manager regression failed before the fix with not_applicable instead of session_queued for the second execution (1 failed, 10 passed). After the fix, 218 tests across six owner and sibling files passed, along with check-changed and an independent P2 review. The two modified test files passed on one worker in 27.93s Vitest wall / 40.03s wrapper wall; the regression took 827ms and the added duplicate control 738ms. All validation ran remotely; local commit hooks were disabled for the explicitly constrained host.
f0d9a38 to
8107a5d
Compare
|
Merged via squash.
|
…claw#159173) Distinct ACP executions can share a requester, child session, and request ID while retaining separate task and flow IDs. Include the persisted ACP instance ID in notification peer selection so an older execution cannot suppress the next completion. Preserve deduplication for same-instance projections and legacy records, and document the notification contract. On Blacksmith Testbox, the manager regression failed before the fix with not_applicable instead of session_queued for the second execution (1 failed, 10 passed). After the fix, 218 tests across six owner and sibling files passed, along with check-changed and an independent P2 review. The two modified test files passed on one worker in 27.93s Vitest wall / 40.03s wrapper wall; the regression took 827ms and the added duplicate control 738ms. All validation ran remotely; local commit hooks were disabled for the explicitly constrained host. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Two ACP executions can share a requester, child session, and request/run ID while being distinct executions: task creation gives each its own task and flow ID (documented in
docs/automation/tasks.md). When execution A finished and a later execution B with the same request ID finished, B's completion notice was never sent or queued. Its task record showed the result, but the requester was never told.Why This Change Was Made
Completion-notice dedupe (
getPeerTasksForDeliveryinsrc/tasks/task-notification-routing.ts) treated every task with the same run ID, runtime, scope, owner, and child session as a duplicate projection of one execution. It grouped A and B together, picked the oldest task as the delivery owner, and marked B's deliverynot_applicable.The dedupe identity now matches the identity task creation already uses: for ACP tasks, peers must also share the backing execution
instanceId. Duplicate projections of the same execution still collapse to one notice, non-ACP runtimes are unchanged, and records without an instance ID keep deduping with each other as before. The tasks doc now states that each execution gets its own completion notice.User Impact
A repeated ACP request (same request ID, new execution) now produces its own completion notification instead of silently finishing. Notices already suppressed by earlier versions are not replayed.
Evidence
src/acp/control-plane/manager.background-task.test.ts: new case fails onmain(B getsnot_applicableinstead ofsession_queued) and passes with the fix.node scripts/check-changed.mjspassed.Production LOC: +11 / −4. Tests: +48 / −25. Docs: +1 / −1.