Skip to content

fix(test): expect managed worktrees for sandboxed URL spawns - #196271

Closed
roboclaw-bot wants to merge 1 commit into
mainfrom
loops/l474-create-worktree-sandbox
Closed

roboclaw-bot wants to merge 1 commit into
mainfrom
loops/l474-create-worktree-sandbox

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes scheduled main CI rejecting a successful sandbox-required repository URL spawn after #196206 made repository URL sessions use managed worktrees.

User Impact

No product behavior changes. The test now verifies that URL spawns keep the required sandbox and receive an owned checkout when worktree is false or omitted. Registered local folders outside the sandbox still fail without a managed worktree.

Why This Change Was Made

Commit 97e91a16d636cbf25fff55728de21afc1578ac53 intentionally removed direct URL-to-clone session binding, but this visible-spawn test still expected a failed session. Reuse its successful-spawn assertions for URL requests and verify registry ownership, session cwd/root, source isolation, dispatch, and disabled setup scripts. Remove the obsolete failure branch and its unreachable registry assertion. Production delta: 0 lines; test delta: +22/-22. No baseline changes.

Related: #196206. Main failure: scheduled run 42692902936, job 129418193712, head e64c3514e4194c1100779f9617f2d0c7b0439c4c.

Evidence

  • Reproduced the original assertion at line 307 on unchanged source: sandbox remained required; the expected status: failed was absent. One failed test, 67.15 s wall time.
  • Full named file src/gateway/server.sessions.create-worktree-spawn.test.ts: 28/28 passed, 132.49 s wall time, using the repository Vitest wrapper on Node with one worker. This boundary suite uses real fixture Git repositories and SQLite; GitHub materialization and agent dispatch are mocked. It also covers cancellation, stale parents, registry ownership, failed preparation, and deferred retries.
  • Direct touched-file oxlint with type-aware rules and TypeScript diagnostics passed; touched-file oxfmt and git diff --check passed.
  • Independent Codex autoreview of the complete local candidate against b09f5e65212882bdc68df70fd1da833c9a9c8f33: scoped-clean through P2; no findings. Model: GPT-6.1 Sol, medium reasoning. No tests were run by the reviewer.

Broad proof and CI timing are pending PR CI. No workflow dispatch, rerun, containers, PostgreSQL, or browser E2E was used for this fix.

Work sessions

Linked for team reference; these sessions aren’t public.

Discussion, implementation and verification

Align visible-spawn proof with the repository URL placement contract from #196206. Preserve required sandbox inheritance and registered-folder rejection while verifying the owned checkout and dispatch for false or omitted worktree intent.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 9, 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 gateway Gateway runtime size: XS labels Nov 9, 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 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Updates sandboxed repository-URL spawn tests to expect an owned worktree when worktree intent is false or omitted.

Example: A sandbox-required parent spawns from [email protected]:example/selected.git with worktree=false.

  • Before: The test incorrectly expects a failed child session.
  • After: The test expects an accepted child with sandbox=required, an owned checkout, and no setup-script execution.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, correct test repair with passing exact-head CI and reported boundary-suite validation; evidence is an in-process harness rather than a shipped-entry-point demonstration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only repair changes no shipped behavior; supplied validation exercises the real spawn and worktree owners with fixture Git repositories and SQLite, while clone materialization and agent dispatch remain mocked.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Main CI rejects a successful sandboxed repository-URL spawn because the test expects the previous placement behavior.
Reason: The maintainer-authored patch aligns coverage with the merged product contract without changing runtime behavior or weakening the registered-folder boundary.

Merge readiness

✅ Ready for maintainer review

This PR correctly repairs obsolete test expectations after the intentional managed-worktree change; no introduced defects were found, and the exact-head CI gate passes.

Priority: P2
Reviewed head: 16f7c7059c89694543e4a9bee398be1f466c09d2

Before merge

None.

Findings

None.

Agent review details

How this fits together

The visible session-spawn tool sends project selection through Gateway session creation and workspace preparation, which bind the child session to a managed checkout before dispatch.

flowchart LR
  A[Visible spawn tool] --> B[Gateway session creation]
  B --> C[Repository URL preparation]
  C --> D[Managed worktree owner]
  D --> E[Child session workspace]
  E --> F[Agent dispatch]
Loading

Technical review

Best possible solution:

Merge this focused test repair using the existing spawn suite and managed-worktree owner.

Do we have a high-confidence way to reproduce the issue?

The base test expects URL-spawn failure, while current production preparation unconditionally allocates a managed checkout for pending repository URLs; the author also reports reproducing that assertion failure.

Is this the best way to solve the issue?

This is the smallest complete repair: reuse successful-spawn assertions for URL requests while retaining the registered-folder rejection and sandbox protections.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d122c1b06011.

Provenance checked

  • Required-sandbox project spawn expectations keeps the original intent (28d8ee4: Allow sandboxed sessions to use isolated managed projects while retaining restrictions on direct external-folder access; later test cleanup consolidated these cases.)
  • Repository-URL failure expectation changes intended behavior with a stated reason (5d671d1: Test cleanup retained the then-current URL failure case; the later merged placement change intentionally removed direct URL-to-clone binding.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 97e91a1 adds src/gateway/server-methods/session-create-project.ts:418 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 97e91a16d636; files: src/gateway/server-methods/session-create-project.ts)
  • RoboClaw: Raw commit 28d8ee4 adds src/gateway/server.sessions.create-worktree-spawn.test.ts:433 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 28d8ee4f096b; files: src/gateway/server.sessions.create-worktree-spawn.test.ts)

PR surface

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

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

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:

No label changes.

Label justifications:

  • P2: Repairs a bounded main-CI test failure without changing production behavior.
  • 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 9, 2026, 4:51 PM ET / 21:51 UTC.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Superseded by #196889 (ff392db). Current main now treats GitHub URL sources as managed worktrees, accepts the formerly failing sandbox-required URL case, and preserves rejection of external registered folders. That owner fix resolves this PR’s stated CI failure; closing this redundant repair rather than layering another fixture rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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.

1 participant