Repository navigation
fix(agent-core): close tool batches at the launch boundary - #129293
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 10:24 PM ET / August 26, 2026, 02:24 UTC. ClawSweeper reviewWhat this changesThe PR moves tool-batch commitment to the immediate launch boundary, preserves tool lifecycle outcomes after an admission failure, and clones caller message arrays for all exported loop entry points. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer landing: the prior caller-context finding is resolved on the current head, and this review found no new blocking defect; exact-head CI and normal maintainer review remain pending. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAgent Core accepts model tool calls, validates and admits them through the agent loop, then dispatches tool side effects and emits transcript/lifecycle events. The changed boundary is between preparing a tool call and allowing its implementation to start. flowchart LR
A[Model tool calls] --> B[Agent loop]
B --> C[Batch admission]
C --> D[Launch commitment]
D --> E[Tool side effect]
E --> F[Lifecycle and transcript events]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -62, Tests +270. Total +208 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the canonical launch-boundary flow once exact-head validation confirms both the lifecycle contract and caller-transcript isolation on the current main base. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main launches ready parallel executions through Promise.all, while the PR’s coordinator closes admission immediately before each implementation starts; the new focused tests exercise the rejection and transcript paths. Is this the best way to solve the issue? Yes. Centralizing the commitment at the shared launch boundary removes the split admission state while preserving one lifecycle owner, rather than adding downstream guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 637da87a5da1. 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
HistoryReview history (3 earlier review cycles)
|
1c4eb75 to
424955d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Summary
Root cause
Tool execution admission and lifecycle settlement were spread across launch and result paths, allowing stale run state to reach a prepared tool. During consolidation, the empty-prompt path also reused the caller's messages array while the loop appends assistant and tool-result messages, violating the existing public context-isolation contract.
The current-main reconstruction keeps all intervening owner changes, centralizes launch admission, and restores an unconditional context clone before the loop mutates its working transcript.
User impact
Verification
Surface