Skip to content

fix: close worktree dialog before slow script checks - #25472

Merged
nwparker merged 2 commits into
mainfrom
nwparker/worktree-dialog-blocking
Oct 5, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/worktree-dialog-blocking

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​359 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​359
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​158 $\color{#cf222e}{\Huge{\mathbf{−}}}$​131 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27

ELI5

Clicking Create worktree no longer leaves the dialog open while Orca inspects setup scripts. The existing workspace preparation screen takes over, so you can keep using the app.

What Changed

Move setup-script inspection, issue-command confirmation, and VM recipe confirmation into the background creation flow. Capture the selected execution host for script checks, creation dispatch, retry, and the returned worktree, show the existing Preparing workspace state, and preserve cancellation, trust refusal, and retry behavior. Required setup choices remain in the composer.

Why

Script inspection can take seconds, particularly on remote hosts. Reusing the existing preparation screen removes that wait from the dialog without adding another loading UI or bypassing script trust checks.

Linked Issue

Reported directly by the maintainer; no linked issue.

Visual Proof

Before: the reported dialog stays open after Create.

Before: dialog remains open after Create

After: the creation tab and sidebar show Preparing workspace while the rest of Orca remains accessible.

After: non-blocking workspace preparation

In a hidden macOS Electron app, with hook inspection deliberately delayed by five seconds, the dialog closed in 76–77 ms. Creation completed after preparation; cancelling during preparation prevented creation.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

72 focused tests passed across creation flow, script preparation, duplicate handling, failure recovery, and request construction. New tests cover delayed trust checks, cancellation, refused setup/VM scripts, issue-command host routing, and preparation retry.

pnpm tc:web, changed-code quality checks, targeted test lint, and git diff --check passed. Electron validation used ORCA_BACKGROUND_LAUNCH=1 and Playwright CDP on macOS. Actual SSH, Linux, and Windows were not exercised; host routing is covered by unit tests. Full lint/typecheck/test/build remain for CI.

Review

Adversarial review found and fixed a host-selection race: switching runtimes during preparation could send creation to the newly focused runtime. Regression tests reproduced it before the fix and now verify local, SSH, and paired-runtime dispatch plus ownership after switching focus during creation. Also reviewed request handoff, cancellation, trust refusal, retry, duplicate handling, setup-policy defaults, and folder-workspace behavior; no other blocking findings remain.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only change; no wire protocol, path handling, keyboard shortcut, or agent status changes. Folder-workspace creation retains its existing flow. Metadata resolution, explicit setup choices, and pending preference saves can still precede the background handoff.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant