Repository navigation
fix(gateway): child runs reject their own transcript access - #168285
jaxonparrott wants to merge 1 commit into
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 real behavior proof before merge. What this changesThis PR starts independent Gateway agent turns outside the caller’s transcript-write context. Example: A run owning agent:main:dashboard:parent launches child-session in agent:main:main.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this PR provides a focused repair for inherited transcript ownership that current main still permits, with no definite introduced correctness defect found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway turn service receives prepared requests and caller authority, then owns session admission, dispatch, completion, and cleanup. flowchart TD
A[Parent agent tool] --> B[Gateway request authorization]
B --> C[Independent turn service]
C --> D[Session and input admission]
D --> E[Child runtime and transcript owner]
E --> F[Transcript storage]
E --> G[Completion and cleanup]
Technical reviewBest possible solution: Keep isolation at the shared independent-turn owner while preserving caller admission, acceptance transfer, and child-owned transcript fencing. Do we have a high-confidence way to reproduce the issue? Source shows captured caller context reaching independent dispatch and foreign-target rejection during transcript preparation; no current-main runtime reproduction was executed, and related reports include both failures and a successful narrower scenario. Is this the best way to solve the issue? The existing isolation helper at the shared turn owner addresses context leakage coherently without duplicating policy or removing explicit admission assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f207a608131a. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was found; the remaining authority uncertainty is tracked in the merge risk. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +216. Total +222 across 3 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 2:51 AM ET / 06:51 UTC (Revision 2). |
|
Live downstream evidence (2026-10-10): the selected fork fa05b48 containing this fix is now deployed via Bramwell-Inc/jarvis#1509, merge ccd0f503f0c5c0768c279ea7187c6e507ffe3186, Railway deployment a54739b6-85cb-4580-9a55-2fab5540ef7c. Installed source, package integrity and build ID were verified. A real GPT parent launched three configured Claude children (Opus/Sonnet). Each performed a real file-read, persisted exactly one final response and reached done. The parent yielded, received native completion settlement, automatically resumed and returned all three results. Neither parent nor children used history polling, retries, manual recovery or manual completion messages. This verifies actual provider-backed idle child persistence and automatic handoff on that selected fork, not on this exact upstream head. Queued and negative-boundary qualifications remain separate. A synthetic native CLI queued fixture failed with cli_live_session_changed on both the prior 938 package and fa05; this is not a clean queued pass. A real same-parent explicit followup check instead rejected before admission with "Followup has no retained original caller policy." Its original child still completed and woke the parent normally. That separate native authority propagation path is being traced; no permissions were weakened or send replayed. A reset canceled a held synthetic CLI child and left replacement storage unchanged, but did not observe the requested delayed stale-writer append rejection. Revoked-caller-before-commit proof also remains unclaimed. These receipts therefore do not remove the remaining runtime-composition review boundary. |
What Problem This Solves
Fixes: an independently launched agent run can reject its own transcript access when an in-process parent launches it while holding another session's writer claim.
User Impact
Child runs can prepare and access their own transcripts whether they start immediately or wait behind a busy session. Parent writer fences, stale-owner checks, and target-bound write guards remain enforced.
Why This Change Was Made
Clear only the caller's transcript-write context at the shared independent-turn entry point using the existing native helper. Keep all request, admission, authorization, lifecycle, and commit assertions intact. The new run acquires its own transcript owner through the existing flow; no new state or permission is introduced.
Evidence
The regression uses the existing agent-handler fixture and synthetic sessions to check idle child admission, queued child admission, and preservation of stale parent and captured post-commit guards.
Before extraction, a separate source-qualified checkout demonstrated all three regressions failing on the original entry point, then passing with this fix. Its complete agent-handler suite passed 393 tests, and related transcript/compaction/spawn/follow-up suites passed 125 tests. Those broader totals belong to that source checkout, not this upstream PR head.
Current upstream-head qualification is recorded below. No provider call, live handoff, deployment, or external delivery is claimed by these unit tests. Package builds and production mutations were outside this contribution's scope.
On official main
6d3f75a1baa71ea5f51db7150ba1eb2d6f067be1, isolated Railway qualification ranpnpm test src/gateway/server-methods/agent.test.ts --maxWorkers=1 -t 'foreign transcript owner': 3/3 passed (399 unrelated cases skipped), 235.32 seconds runner time and 236.654 seconds wall time, including 107.053 seconds cold worker preparation. Afterward, the redundant default<void>type argument was removed for current typed-lint rules; emitted behavior is unchanged. This timing includes the existing suite's import/startup cost; the queued and stale-parent cases themselves took 45 ms and 31 ms.Formatting and
git diff --checkpass. Fresh independent source review found no blocking findings. The cold worker compiler reported upstream MDX/HAST module-directive and plugin-timing diagnostics; these are recorded separately from regression assertions and changed-file lint. Exact-head upstream CI completed: all applicable jobs succeeded, including test shards, production/test types, lint, and architecture checks; the aggregate CI gate reports success.Final changed-file native typed lint passes with zero warnings/errors (264 rules, 38.8 seconds). Reviewed head:
ec053c41edfc1ef4188a0a3c732e887e529b38f9. All three final source SHA-256 hashes match the isolated Railway source. No cumulative fork changes accompany this three-file contribution.The exact-head CI gate is green. ClawSweeper review found no definite correctness defect or concrete bypass, but retains a security/proof hold until a real Gateway parent launches idle and queued children that access/persist their own transcripts, with final-effect rejection of a revoked caller before input commit and a replaced child writer before append. The existing mocked-handler proof does not satisfy that requested runtime composition, and no such proof is claimed here.