Repository navigation
fix: align spawn custody tests with initiator ownership - #201027
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. What this changesUpdates visible-spawn tests to expect Alice’s ownership even when Bob is selected to execute the work. Example: Alice initiates a turn that creates visible work using Bob’s execution authority.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused correction to stale ownership assertions while preserving the separate execution-authority checks. No actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe participant boundary suite invokes session tools through in-process Gateway creation and admission, then checks persisted ownership, creator attribution, and execution authority. flowchart TD
A[Alice initiates work] --> B[Tool selects Bob]
B --> C[Gateway session creation]
C --> D[Initiator ownership assignment]
D --> E[Persisted child session]
E --> F[Boundary assertions]
Technical reviewBest possible solution: Keep the existing ownership producer and update the stale expectations without weakening execution-authority or creator-attribution coverage. Do we have a high-confidence way to reproduce the issue? The base expects agent ownership for Bob-selected visible work, while the verified production path assigns Alice through captured initiator identity; the PR reports matching base failures and candidate passes, but this read-only review ran no tests. Is this the best way to solve the issue? This is the smallest complete correction: it changes only the obsolete expected value and retains distinct persisted ownership, receipt, creator, and execution-authority checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d905d8a68570. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -2. Total -2 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
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 Reviewed November 18, 2026, 1:07 AM ET / 06:07 UTC. |
|
Merged via squash.
|
Bounded beta2 FRV repair; preserve the existing runtime contract and original failure assertions. Combined qualification follows integration. Selected source hunks only; unrelated source changes excluded. (cherry picked from commit ee3f5a7) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
The recursive spawn boundary suite fails on unrelated PRs when Bob is selected to execute work initiated by Alice. Both visible cases still expect agent ownership after #200952 changed new work to belong to its captured initiator.
User Impact
No user-visible behavior changes. CI now checks the intended ownership while retaining the separate assertions for Bob's execution authority and Alice's creator attribution.
Why This Change Was Made
Expect Alice as the owner for both supervised and independent visible work. Remove the obsolete conditional expectation; retain both stored-owner and tool-receipt assertions. Production code is unchanged. Test delta: +2/−4 lines.
Evidence
4698d8f832a: the four participant cases reproduce the exact signature (2 failed, 2 passed). Candidate: all 4 pass. Same owning CI config and Bun runtime; no retries, timeout changes, or weakened checks.timeout 150s node scripts/run-vitest.mjs src/agents/subagents/spawn/subagent-spawn.production-boundary.test.ts --maxWorkers=1 -t 'delegates participant custody'. Base Vitest time 46.31 s; candidate 23.94 s (wrapper wall time 25.28 s). These are filtered runs, not a performance comparison.timeout 60s node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/subagents/spawn/subagent-spawn.participants.test-support.tspassed. Touched-fileoxfmt --checkandgit diff --checkpassed.4698d8f832a, with production ownership/selection context:scoped-clean, no actionable findings.check-prod-typesandcheck-test-types-core-4(coreandcore-test-agents-sessions). The sole runtime importing suite issubagent-spawn.production-boundary.test.ts; the worktree helper's type-only import also feeds that suite.ascii-boxrefused allocation immediately: missingASCII_BOX_API_KEY. Full compact-job replay and the requested repeated/load configurations were not run on the production host. An initial full named-file baseline attempt hit its 120 s command limit before the participant cases; it is not passing proof.Root cause, original shard, and owner producer audit
The original compact job failed both visible cases, with 142 other tests passing. Its tested merge commit
59cc755398166f1b7feb1e6c00409fb490aba3f3includese235b2b983b(#200952), even though PR head53fca7c1diverges from that change. This is a deterministic stale assertion on the merged source, not evidence of cross-case identity leakage.The compact payload contains these groups in order: infra/storage-state hosted-11 (10 files), spawn production boundary (1 file), Gateway hosted-2 (3 files), agent core auth (1 file), Gateway hosted-8 (4 files), infra/storage-state hosted-13 (7 files). The shard runner starts separate child processes for each group. The spawn group's only file is the named production-boundary suite, with
isolate: trueand forked workers. The full 26-file compact replay requires remote capacity.gateway-caller-context.ts:351preserves Alice asdelegatedCreatorProfileIdwhen selecting Bob.sessions-spawn-visible.ts:413stamps that initiator on creation.session-create-inheritance.ts:183–193intentionally selectsactor.delegatedByfor ownership. The existing participant test already independently asserts Alice's causal identity at lines 287–293 and Bob's selected authority at line 285. The old conditional at line 328 was the missed consumer of #200952.Alice directly matches the parent's assigned human owner in
inheritSpawnSessionOwner, so this path bypasses profile alias resolution. The reproduced mismatch does not depend on catalog readiness, a profile cache, or the ordering of Bob's participant recording.Owner producers reachable from this case:
assignSessionOwnerparticipants.test-support.ts:111).session-create-service.ts:808,session-accessor.sqlite-creation.ts:299/323, projection/replacement state owner).subagent-spawn-session-patch.ts; supplies no owner assignment.session-participant-recording.ts,session-accessor.sqlite-participants.native.ts).session-accessor.sqlite-entry-write.ts:439/456); do not choose a new actor.The native owner-column writer is
replaceSessionOwnerInTransaction; its other callers are explicit reassignment, lifecycle creation/replacement, and repair/copy operations. No reassignment RPC or repair/migration producer is scheduled by this case. No production ownership defect was found.