Skip to content

Speed up worktree creation with a gated early terminal - #13704

Closed
nwparker wants to merge 0 commit into
mainfrom
nwparker/fast-create-worktree-person-running-person-running
Closed

nwparker wants to merge 0 commit into
mainfrom
nwparker/fast-create-worktree-person-running-person-running

Conversation

@nwparker

@nwparker nwparker commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 42 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5218 $\color{#cf222e}{\Huge{\mathbf{−}}}$​100 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5118
Prod 60 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4873 $\color{#cf222e}{\Huge{\mathbf{−}}}$​872 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4001

Summary

  • parallelize independent username, base/ref, shared-path, include-file, and terminal-preparation work during worktree creation
  • split ordinary creation into git worktree add --no-checkout plus explicit materialization, preserving Git 2.25 and global-option ordering
  • reuse authoritative local-branch absence evidence to remove duplicate Git subprocesses across local, WSL, SSH, and runtime paths
  • add phase timing diagnostics without retaining completed mutable Git results
  • add an off-by-default experimental early terminal for local desktop and WSL worktree creation

Early-terminal safety model

The optional terminal can become visible while checkout is in progress, but it is held behind a nonce-bound gate:

  • pre-release input is swallowed and echo is disabled
  • startup agents, setup, default tabs, trust mutation, and sibling terminals stay blocked
  • the original interactive shell receives startup only after checkout and readiness complete, so project prompt hooks reload against materialized files
  • release is one atomic write and must be acknowledged by the same PTY before startup telemetry is emitted
  • cancellation linearizes before release; checkout rollback requires verified physical PTY stop
  • local/daemon/WSL outer shell environments remove inherited BASH_ENV and ENV
  • a post-spawn provider-publication failure retains the exact committed PTY ID and enters the same bounded stop/fail-closed path

The setting remains experimental and disabled by default.

Visual report

Open the committed HTML engineering report

Fast worktree creation report, dark theme

Light theme and responsive proof

Fast worktree creation report, light theme

Fast worktree creation report, responsive layout

The report uses Orca's canonical design tokens. Axe WCAG A/AA audits pass with zero violations in both light and dark mode.

Provider and compatibility behavior

Surface Fast creation Early terminal
Local desktop two-phase + parallel discovery optional
WSL distro-routed two-phase Git optional POSIX gate
SSH / relay materialization RPC with method-not-found fallback intentionally disabled
Paired runtime host-owned materialization omitted from wire payload
Folder workspace existing behavior not applicable
  • exchanged fields are additive/optional; the pinned current/v1.4.178 terminal-wire contract passes in both directions
  • direct SSH retains advisory cancellation and old-relay fallback behavior
  • provider-neutral work-item/review behavior remains intact
  • no dependency, lockfile, native-binary, or generated build-artifact changes

Verification

  • ORCA_CROSS_VERSION_BASELINE_REF=v1.4.178 pnpm test: 49,287 passed, 98 skipped
  • focused 20-file main safety gate: 1,254 passed, 7 skipped
  • full runtime suite: 1,104 passed, 1 skipped
  • renderer gate: 383 passed
  • Git 2.25.1 real-binary compatibility: 7/7 passed
  • Git 2.44.0 real-binary compatibility: 7/7 passed
  • pinned current/v1.4.178 terminal-wire compatibility: 4/4 passed
  • headless Electron: success and checkout-failure journeys passed once and with --repeat-each=3 (8 executions total)
  • pnpm run typecheck
  • pnpm run lint (only pre-existing WorktreeJumpPalette exhaustive-deps warnings)
  • pnpm run check:reliability-gates: 74 gates passed
  • changed/new-file formatting and git diff --check
  • HTML report axe audit: 0 WCAG A/AA violations in both themes

Residual evidence gaps

  • no physical Windows, Linux, or WSL journey was collected
  • no live SSH transport or actual old-relay run was collected
  • cancellation/setup/default-tab/release-failure Electron variants remain unit-only
  • raw provider admission and crash-persistent checkout-barrier limits remain documented experimental gaps
  • phase timings are instrumented, but no reproducible end-to-end performance benchmark is recorded

These gaps keep the early-terminal option experimental and off by default; they are not open P0/P1/P2 review findings.

@nwparker

Copy link
Copy Markdown
Contributor Author

Follow-up split completed:

Recommendation remains to keep this broad early-terminal/PTY/relay PR draft and review those slices independently; no cherry-pick or merge into #17290 is needed.

@nwparker nwparker closed this Aug 30, 2026
@nwparker
nwparker force-pushed the nwparker/fast-create-worktree-person-running-person-running branch from 0e4d244 to ba5f334 Compare August 30, 2026 20:02
@nwparker
nwparker temporarily deployed to adhoc-mac-build August 30, 2026 20:20 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
adhoc-mac-build — ba5f3340 Deployed Aug 30, 2026 by nwparker via build-hourly-win / build-win #680
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