Repository navigation
fix: preserve requester tools after subagents settle - #160786
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. |
|
@clawsweeper review Exact head: |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 8:04 PM ET / September 29, 2026, 00:04 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch preserves a requester's captured tool policy when its subagents settle, while binding the handoff to the admitted batch and checking revocation before tool effects. Merge readiness✅ Ready for maintainer review Current main still lacks the settled-requester fix. The current head addresses the earlier replay-source finding, and this review found no discrete blocking defect. Priority: P1 Review scores
Verification
How this fits togetherGateway admits subagent completion input and passes it to the agent runner. The runner selects tools under the requester's policy, and those tools can then perform process or file effects. flowchart LR
A[Settled subagents] --> B[Gateway replay admission]
B --> C[One-use completion handoff]
C --> D[Requester policy check]
D --> E[Agent tools]
E --> F[Guarded effects]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +82, Tests +263, Docs +8. Total +353 across 13 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one completion-capability path that restores the captured requester policy only for an admitted, current batch and rechecks revocation at tool effects. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source and the reported baseline run give a high-confidence path: a requester with an exact sender tool override yields to children, then its settle continuation loses exec. I did not execute that path in this read-only review. Is this the best way to solve the issue? Yes. The patch extends the existing completion-capability and requester-policy owners, and the inspected path retains the ordinary restricted policy when batch evidence fails. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 91a86e494e86. 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
History |
|
* fix: preserve requester tools after subagents settle * fix: retain settled authority through replay and tool execution
Related: #109025
What Problem This Solves
Fixes authorized tools disappearing when a yielded parent resumes after its children settle.
User Impact
The resumed requester retains the policy captured at spawn, including its existing restrictions. Revoked authority and stale requester sessions cannot restore access. Missing or conflicting child policies leave the continuation under its ordinary restricted policy. No configuration or migration is required.
Why This Change Was Made
Extend the existing completion capability and requester-policy owners to recognize settled continuations, bind them to the current requester and exact batch, and verify every child's persisted policy. Bind replay to the child source actually accepted by transcript admission. Reply-authority snapshots preserve the settle owner's live revocation check, and the existing tool source fence checks it again at final I/O. Direct announce behavior remains intact; no sender identity is synthesized.
Evidence
after-snapshotrestored 29 tools, created the proof marker, and sent the visible final. The unchanged scenario still failed its exact-once exec assertion.189d179f2798006b64728a6b941df9065e98c352, found no actionable findings, and marked it ready for maintainer review.pnpm test <file> --maxWorkers=1: requester-policy file 34.11 seconds including a cold worker build (about 1.7 seconds executing tests); capability file 3.23 seconds (0.12 seconds executing tests). After review, the exec-runtime file passed 31 tests in 31.62 seconds wall and the private-completion file passed 22 tests in 64.46 seconds wall, both including compilation. The new Gateway replay case took 1.85 seconds in the combined focused run; the three final-spawn cases took 11 ms total. Hosted summed case durations for the complete files were requester-policy 1.460 seconds (34 tests), capability 0.042 seconds (11), exec-runtime 0.262 seconds (31), and private-completion 24.833 seconds (22), excluding shared setup/build time.189d179f2798006b64728a6b941df9065e98c352.node scripts/detect-private-keys.mts(owned by.pre-commit-config.yaml), was invoked once for the requested final-candidate verification on189d179f2798006b64728a6b941df9065e98c352. It exited 0: 50,476 tracked files scanned, no private keys found. Diagnostic runtime and staged roots were removed through the QA cleanup owner; concise local evidence is preserved.codex --yolo, which conflicts with the helper's isolation controls. The permitted Claude safe-mode fallback is concretely absent (executable not found: claude). No autoreview verdict was produced. No additional engine was tried and no isolation workaround was used in this resumed lane. The user explicitly authorized proceeding with this unavailable gate recorded.No merge, queue, or automerge is requested.