Skip to content

fix: align spawn custody tests with initiator ownership - #201027

Merged
roboclaw-bot merged 1 commit into
mainfrom
flake/l90-spawn-participant-custody
Nov 18, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
flake/l90-spawn-participant-custody

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Base 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.
  • Focused command: 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.
  • Touched-file type-aware lint: timeout 60s node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/subagents/spawn/subagent-spawn.participants.test-support.ts passed. Touched-file oxfmt --check and git diff --check passed.
  • Autoreview (Codex, P0–P2) of the complete local delta against 4698d8f832a, with production ownership/selection context: scoped-clean, no actionable findings.
  • Exact-head PR CI passed. The complete importing suite passed 144/144, including both formerly failing visible cases, in 813.87 s Vitest time / 815.55 s wrapper wall time (job log). This existing suite composes real Gateway admission, authority, supervision, lifetimes, and managed worktrees; the patch adds no test cases. All four planned changed-test invocations completed successfully.
  • Standalone production and consumer test typechecks passed: check-prod-types and check-test-types-core-4 (core and core-test-agents-sessions). The sole runtime importing suite is subagent-spawn.production-boundary.test.ts; the worktree helper's type-only import also feeds that suite.
  • Crabbox provider ascii-box refused allocation immediately: missing ASCII_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 59cc755398166f1b7feb1e6c00409fb490aba3f3 includes e235b2b983b (#200952), even though PR head 53fca7c1 diverges 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: true and forked workers. The full 26-file compact replay requires remote capacity.

gateway-caller-context.ts:351 preserves Alice as delegatedCreatorProfileId when selecting Bob. sessions-spawn-visible.ts:413 stamps that initiator on creation. session-create-inheritance.ts:183–193 intentionally selects actor.delegatedBy for 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:

Producer Effect
Participant fixture assignSessionOwner Assigns the parent to Alice once, before child creation (participants.test-support.ts:111).
Visible spawn and independent create Both use Gateway creation inheritance; atomic creation commits the resulting Alice assignment (session-create-service.ts:808, session-accessor.sqlite-creation.ts:299/323, projection/replacement state owner).
Hidden/queued spawn initialization Writes creation metadata through subagent-spawn-session-patch.ts; supplies no owner assignment.
Bob's steer / participant recording Changes execution participant authority and participant aggregates; writes no owner columns (session-participant-recording.ts, session-accessor.sqlite-participants.native.ts).
Agent run metadata/completion Generic entry writes retain authoritative owner side metadata (session-accessor.sqlite-entry-write.ts:439/456); do not choose a new actor.
Teardown Settles children and deletes isolated state; does not reassign an 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.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Updates 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.

  • Before: The test expects agent main to own the child and fails when production assigns Alice.
  • After: The test expects Alice to own the child while still asserting Bob’s execution authority.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-consistent test repair supported by reported boundary runs; broader exact-head validation remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) This test-only correction requires no shipped-entry-point demonstration; reported base-red/head-green participant runs support it, with full importing-suite CI still pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Unrelated contributions encounter failing spawn tests despite production following the intended initiator-ownership behavior.
Reason: The maintainer-authored direction matches the merged ownership decision and repairs validation without changing runtime behavior.

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
Reviewed head: 81414dfb28d048b4229835cf9983fb1bb96e9c52

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Visible participant ownership expectations changes intended behavior with a stated reason (727d79d: The last substantive rewrite consolidated participant scenarios while retaining distinct authority and lifecycle checks; the later merged initiator-ownership change explicitly superseded this expected ownership value.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 3097cee adds src/agents/subagents/spawn/subagent-spawn.participants.test-support.ts:292 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3097ceed2255; files: src/agents/subagents/spawn/subagent-spawn.participants.test-support.ts)
  • Peter Steinberger: Raw commit 727d79d adds src/agents/subagents/spawn/subagent-spawn.participants.test-support.ts:290 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 727d79deb419; files: src/agents/subagents/spawn/subagent-spawn.participants.test-support.ts)

PR surface

Tests -2. Total -2 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 4 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 4 -2

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Deterministically stale assertions disrupt unrelated PR validation, while runtime ownership already follows the intended contract.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Deterministically stale assertions disrupt unrelated PR validation, while runtime ownership already follows the intended contract.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 1:07 AM ET / 06:07 UTC.

@vincentkoc vincentkoc self-assigned this Nov 18, 2026
@roboclaw-bot
roboclaw-bot merged commit ee3f5a7 into main Nov 18, 2026
134 checks passed
@roboclaw-bot
roboclaw-bot deleted the flake/l90-spawn-participant-custody branch November 18, 2026 06:24
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
RomneyDa added a commit that referenced this pull request Nov 20, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants