Repository navigation
fix(agents): await execution callback settlement - #150396
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: blocked before merge. Reviewed September 20, 2026, 4:27 AM ET / 08:27 UTC (Revision 4). ClawSweeper reviewWhat this changesMakes agent startup and ACP completion await accepted callback work, preserves cancellation checks and cleanup, and updates regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful repair: current main still ignores callback settlement. No actionable correctness findings remain. The prior compatibility concern is explicitly acknowledged in the maintainer-authored PR and does not establish a new repair requirement. Priority: P2 Review scores
Verification
How this fits togetherAgent execution connects Gateway requests and scheduled jobs to embedded, CLI, and worker runtimes. Startup callbacks establish lifecycle bookkeeping before execution continues, while ACP stream handling coordinates notifications and completion. flowchart TD
A[Gateway requests and scheduled jobs] --> B[Run admission]
B --> C[Startup callbacks and owner binding]
C --> D[Await accepted work]
D --> E[Recheck cancellation and authority]
E --> F[Execute selected runtime]
F --> G[Settle notifications and publish completion]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +39, Tests +270. Total +309 across 32 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the maintainer-described settlement contract through the existing runtime owners, retaining synchronous callback compatibility and explicit acceptance of the SDK timing change. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main discards returned startup and binding promises, allowing continuation before settlement. The PR supplies focused failing-before regressions; this review did not execute them. Is this the best way to solve the issue? Yes. Propagating settlement through existing owners is a focused repair, and the patch preserves cleanup and cancellation checks without introducing another execution or storage owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9f5ebbad1e73. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Join accepted execution-start and post-admission work before runtime continuation and terminal publication. Preserve current authority after awaited callbacks, repeated notification settlement, public callback compatibility, and transcript cleanup on startup failure.
9e722ac to
4373514
Compare
|
Merged via squash.
|
* fix(agents): await execution callback settlement Join accepted execution-start and post-admission work before runtime continuation and terminal publication. Preserve current authority after awaited callbacks, repeated notification settlement, public callback compatibility, and transcript cleanup on startup failure. * test(agents): use lifecycle replacement factory in fixture * test(agents): avoid returning timer handles from executors
What Problem This Solves
Execution-start and post-admission callbacks can return work that runtime callers ignore, allowing execution or ACP completion to overtake it. Repeated notifications can also skip a binding that is already in progress.
User Impact
Runtime execution and ACP completion wait for accepted callback work to settle. Existing callbacks still accept incidental synchronous return values. Cancellation and current run authority are checked again after the wait.
Why This Change Was Made
Propagate settlement through the existing CLI, embedded, Gateway, worker-turn, and Cron callers. Repeated binding notifications join one outcome. ACP joins prompt notifications that have already started; unresolved readiness that never started a notification cannot hold terminal completion. The CLI bridge includes startup callbacks in its existing transcript and listener cleanup scope.
This change preserves the current synchronous task, flow, and Cron storage owners. Their physical worker conversion remains separate. A standalone test-only commit corrects a stale prepared-runtime fixture import without changing production code or assertions.
Evidence
Six focused regressions fail before their repairs: both binding arrival orders, ACP terminal publication overtaking a started notification, CLI preparation and dispatch overtaking callbacks, and missing transcript cleanup after a startup callback error. All pass with the repair.
The callback candidate passes 300 tests across ten files, including repeated admission and closure, ACP completion and delivery, CLI entry and dispatch, public SDK compatibility, real Cron receipt/task binding, and the Gateway worker-turn boundary. The fixture correction separately passes 47 tests, its owning types, and its full selected changed-file gate. Fresh independent reviews through P2 found no actionable findings; the composed source preserves both reviewed changes exactly.
Core production and full core test types, targeted typed lint, formatting, package/export boundaries, SDK budgets, and all selected source guards pass. The initial broad gate exposed the stale fixture import, reproduced on the unchanged base; the composed candidate includes the verified correction. Two test-only executor-return lint issues were corrected with behavior-preserving blocks and validated by scoped lint and fresh review. Static proof was completed across the frozen reviewed changes; no single combined aggregate-gate rerun is claimed. Exact-head CI passes at
e88108e8ce8314c245ad9f752adaecf71e5bdc47. Proof used isolated synthetic state; no external provider or operator-state campaign is claimed.Historical CI on the prior head failed a UI bundle budget by 118 bytes and a Codex receipt fixture execution budget. The inspected receipt owners were unchanged and that fixture supplied no modified callback, but no exact-baseline runtime reproduction established the timing cause. Those failures are retained as historical evidence, not described as flaky or current-head success.