Repository navigation
perf(worktree): remove redundant creation and terminal startup work - #18793
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
A performance pass that removes redundant subprocess and renderer work from worktree creation and terminal startup, split as PR A of a two-part change. Reviewed in full: the parallel-checkout config and its Git-version boundary, the base-OID reuse and read overlap in prepared-checkout finalization, the adoption-first branch conflict probe, the remote/username probe short-circuits, the async WSL workspace-root resolution and catalog invalidation ordering, and the terminal replay reconciliation plus ligatures-before-WebGL change.
checkout.workers=4on native macOS —worktreeCheckoutGitArgsgates ondarwinwith nowslDistro, so WSL/Windows/Linux/SSH keep existing settings; documented Git 2.25–2.31 fallback is verified by a real-binary contract.- Reuse resolved base OIDs and overlap independent reads —
resolveWorktreeAddBaseContextreturnseffectiveBaseOidonly when no refresh/suggestion can move the ref;finalizePreparedWorktreesettles both reads viaPromise.allSettledbefore failure cleanup. - Skip unnecessary probes —
probeLocalBranchRefusesrev-parse --verify --quietto distinguish proven absence (no WSL login-shell retry), and explicit existing-branch adoption is deferred behindgetBranchConflictKind'sallowLocalBranchcallback; empty-remote and no-separator bases short-circuit without spawning Git. - Resolve WSL workspace root once, asynchronously —
createLocalWorktreeawaitscomputeWorkspaceRootAsyncand threads the single root throughcomputeWorktreePathfor every name candidate. - Invalidate the catalog before startup —
invalidateWorktreeCatalog(repo.id)runs beforespawnLocalStartupAndSetupTerminalsso the just-created id resolves against a fresh cache. - Paint snapshot-covered startup output once — the daemon-snapshot reattach path now arms the restored-snapshot baseline and records the renderer ordered seq; unsequenced and blank snapshots clear the baseline and retain bytes. PTY reattach also preserves
incarnationId. - Ligatures before the first WebGL atlas —
openTerminalattaches ligatures ahead ofattachWebgl, avoiding an immediate atlas rebuild; toggling still rebuilds.
The test coverage is thorough and the assertions are exact rather than loose: the adoption tests pin subprocess call counts, the OID-reuse tests assert the reused vs re-read OIDs, and the replay tests distinguish covered/legacy/blank snapshot cases. No correctness, security, or cross-platform (SSH/WSL/folder-workspace) concerns identified.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe changes add Git branch adoption probes, effective base OID reuse, asynchronous workspace-root resolution, prepared worktree finalization, and worktree catalog invalidation. They preserve PTY incarnation and snapshot metadata during reattachment, record renderer snapshot baselines, and add terminal ligature initialization during pane creation. Reliability gate, compatibility, integration, and regression tests cover the updated flows. Merge Risk: 🔵 Low · up to Worktree creation and remote-base validation are being optimized, but a malformed remote-base value containing an internal double separator may still yield an invalid branch component. This is a bounded invalid-input handling risk that should be addressed or explicitly accepted before broader reliance on that path. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the technical changes, rationale, testing evidence, risks, and remaining trade-offs. However, it does not follow the required template structure and omits several required sections, including ELI5, What Changed, Why, Linked Issue with a Resolution Rewrite the description using all template headings. Add a brief ELI5 summary, explicit What Changed and Why sections, a valid
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 9a7750cf-8010-41f6-a6cf-75e62f437756
📒 Files selected for processing (40)
config/reliability-gates.jsoncdocs/reference/git-compatibility.mdsrc/main/git/git-username.tssrc/main/git/repo-branch-conflict.test.tssrc/main/git/repo-branch-conflict.tssrc/main/git/repo-username.test.tssrc/main/git/runner-wsl-direct-read.test.tssrc/main/git/worktree-add-creation-config.test.tssrc/main/git/worktree-add-local-base-refresh.test.tssrc/main/git/worktree-add-local-base-suggestion.test.tssrc/main/git/worktree-add.tssrc/main/git/worktree-create-preparation-real-wsl.test.tssrc/main/git/worktree-create-preparation.tssrc/main/git/worktree-preparation-base-oid.test.tssrc/main/ipc/worktree-logic-wsl.test.tssrc/main/ipc/worktree-logic.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees-local-create-flow.test.tssrc/main/ipc/worktrees-test-module-mocks.tssrc/main/ipc/worktrees-test-runtime-stub.tssrc/main/providers/local-pty-provider-spawn-session.test.tssrc/main/providers/local-pty-spawn-state.tssrc/main/runtime/fetch-remote-cache.test.tssrc/main/runtime/orca-runtime-refresh-repo-worktree-scan.tssrc/main/runtime/runtime-local-worktree-create-candidate.tssrc/main/runtime/runtime-remote-fetch-controller.tssrc/main/runtime/worktree-scan-admin-fingerprint-gate.test.tssrc/renderer/src/components/terminal-pane/ipc-pty-connect-result.tssrc/renderer/src/components/terminal-pane/pty-connection-deferred-reattach-live-output.test.tssrc/renderer/src/components/terminal-pane/pty-connection/apply-reattach-payload.tssrc/renderer/src/components/terminal-pane/pty-transport-connect-spawn.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-manager-options.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.test.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.tssrc/renderer/src/lib/pane-manager/pane-manager-pane-creation.tssrc/renderer/src/lib/pane-manager/pane-manager-types.tssrc/renderer/src/lib/pane-manager/pane-split-close.tssrc/shared/git-binary-compatibility.test.tssrc/shared/worktree-checkout-config.test.tssrc/shared/worktree-checkout-config.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Preserve explicit branch adoption, WSL callback routing and sparse cleanup expectations.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The new commit is test-only, pinning the optimized creation call signatures introduced in the prior commit so the assertions match production behavior.
- Sparse-checkout rollback assertion —
add-sparse-worktree.test.tsnow expectsgit -c checkout.workers=4 worktree add …during the sparse-setup failure rollback, matchingperformAddWorktreeafter theworktreeCheckoutGitArgschange (platform is mocked todarwininbeforeEach, so the config is applied). - Adoption-callback call signature —
local-worktree-creation.spec.tsandlocal-worktree-creation-part-02.spec.tspingetBranchConflictKind's new 4th/5th args: thelocalWorktreeGitOptionsobject and theundefinedadoption callback when a branch override prefers existing-branch adoption. - WSL adoption routing —
worktree-removal-and-reconciliation.spec.tsdrives the lazy adoption callback and asserts it re-probes the local ref through WSL (rev-parse --verify --quiet refs/heads/runtime-wsl^{commit}withwslDistro: 'Ubuntu').
Verified locally: add-sparse-worktree.test.ts 5/5 passing; the orca-runtime.test.ts aggregator (which imports the changed .spec.ts files) 1251 passing, 1 skipped.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review is a clean rollback of the parallel-checkout optimization, followed by a merge of main.
- Removed the
checkout.workers=4parallel checkout —9d88718deletessrc/shared/worktree-checkout-config.tsand its test, drops the-c checkout.workers=4args fromperformAddWorktreeand bothreset --hardsites, removes the "Parallel checkout configuration" doc section and the real-binary contract, and reverts the affected test assertions. The removal is complete (no danglingworktreeCheckoutGitArgs/checkout.workersreferences remain), and it resolves the exact tradeoff the PR body had flagged: overriding a user's per-command checkout tuning. - Merged
main—08ae314brings the branch current. The base-OID reuse, adoption-first probe, async WSL workspace-root resolution, catalog invalidation, snapshot-baseline replay, and ligatures-before-atlas changes all remain intact.
One housekeeping note: the PR description still advertises the parallel-checkout behavior ("Use command-local checkout.workers=4 on native macOS") and lists its CPU/I/O and tuning-override tradeoff under merge risk, neither of which the code ships anymore — worth updating so the description matches the merged changes.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 0ba8967a-e9c6-4064-93e4-c9aea69e78bc
📒 Files selected for processing (2)
src/main/runtime/fetch-remote-cache.test.tssrc/main/runtime/runtime-remote-fetch-controller.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| : baseBranch | ||
| // A remote-tracking base needs both a configured remote and a branch component. | ||
| if (!shortBaseBranch.includes('/')) { | ||
| if (shortBaseBranch.indexOf('/') <= 0 || shortBaseBranch.endsWith('/')) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -euo pipefail
if git check-ref-format 'refs/heads//main'; then
echo "Git unexpectedly accepted an empty ref component"
exit 1
fi
rg -n "origin//main|refs/remotes/origin//main" \
src/main/runtime/fetch-remote-cache.test.tsRepository: stablyai/orca
Length of output: 151
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 28681
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- changed hunk ---'
git diff -- src/main/runtime/runtime-remote-fetch-controller.ts
printf '%s\n' '--- controller context ---'
sed -n '180,275p' src/main/runtime/runtime-remote-fetch-controller.ts
printf '%s\n' '--- relevant symbols and tests ---'
rg -n -C 4 \
'shortBaseBranch|RemoteTrackingBase|refs/remotes|fetch-remote-cache|fetchRemote|refresh' \
src/main/runtime/runtime-remote-fetch-controller.ts \
src/main/runtime/fetch-remote-cache.test.tsRepository: stablyai/orca
Length of output: 33502
Reject internal empty path components.
The guard accepts origin//main and refs/remotes/origin//main. The resolver returns branch: '/main', so refresh can construct refs/heads//main. Reject empty slash-separated components while preserving nested branches such as foo/bar/main. Add both cases to the local and WSL table.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review (9d88718) is a single hardening commit that tightens the remote-tracking base probe in resolveRemoteTrackingBase.
- Skip malformed remote base probes — the separator check now rejects slash-less, leading-slash, and trailing-slash bases (
shortBaseBranch.indexOf('/') <= 0 || shortBaseBranch.endsWith('/')), soorigin/,/main,refs/remotes/origin/, andrefs/remotes//mainshort-circuit before spawninggit remote. - Expanded test matrix —
fetch-remote-cache.test.tscovers the four new malformed shapes (plus the WSL-distro path) and renames the case to match the broader contract.
The new check is a strict superset of the previous one: valid remote-tracking bases (remote/branch, including nested remote names like foo/bar/main) still pass, and the newly rejected shapes cannot name a real remote/branch pair. No regressions identified.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review (5e2e2e1) is a single CLI module-loading optimization that keeps the Codex shell preflight off the heavier all-agent hook-controls module.
- Import
prepareManagedCodexHomeBeforeShellLaunchfrom its own module — the static import now resolves directly fromsrc/main/codex/managed-home-shell-preflightinstead ofmanaged-agent-hook-controls, soagent hooks prepare-codexno longer loads the full managed-hook registry (installers, presence detection, script refreshers). - Lazy-load the all-agent hook controls —
applyAgentStatusHooksEnabledandgetManagedAgentHookStatusesare pulled viaawait import('...managed-agent-hook-controls.js')only inside theon/offandstatushandlers, matching the repo's existing.jsdynamic-import convention. - Split the test mocks —
agent-hooks.test.tsnow mocks the preflight from its new module and the remaining hook controls frommanaged-agent-hook-controls, matching the new import graph.
No behavior change: the handlers call the same functions with the same arguments, managed-home-shell-preflight has no dependency back on the controls module (no cycle), and the .js-extension dynamic imports resolve to the same module under Vitest — the offline on/off tests exercise that path.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review (9a84a57) is a single build fix that declares the Codex preflight module as a main electron-vite entry.
- Declared
codex/managed-home-shell-preflightas a main rollup input —electron.vite.config.tsnow mapscodex/managed-home-shell-preflight→src/main/codex/managed-home-shell-preflight.ts, so the packaged CLI'srequire('../../main/codex/managed-home-shell-preflight')(introduced in9a84a57) survives electron-vite'sout/mainclean and resolves from the emittedout/main/codex/managed-home-shell-preflight.js. This mirrors the existingagent-hooks/managed-agent-hook-controlsandclaude-accounts/keychainentries;config/tsconfig.cli.jsonalready lists the source file.
The entry name matches the CLI's relative resolution path, the module's graph is electron-free (node builtins + cross-platform-path + codex/hook-service, and it is re-exported by the guarded agent-hooks/managed-agent-hook-controls entry), and the change has no runtime behavior beyond unblocking the packaged CLI build that the packaging CI caught.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review (a9f00a0) is a single E2E-only commit that closes a race in the repeated relay-restart lease test.
- Waited for the replacement PTY before lease-recovery input — in
ssh-docker-transport-drop-recovery.spec.ts's "keeps one reattachable lease per pane across repeated relay restarts" loop, each generation now capturespreviousPtyIdfirst and polls (waitForActivePanePtyId(...).catch(() => previousPtyId), asserted.not.toBe(previousPtyId)) until the pane's PTY binding actually changes afterkillDockerSshRelayDaemon, before running theLEASE_GEN_nmarker. Previously the marker could target the still-superseded binding, which skewed the reattachable-lease count the test exists to pin at exactly one.
The new poll mirrors the identical pattern already in the "replaces the pane only when the host proves the session is gone" test (same .catch fallback and .not.toBe assertion), so the fix is consistent with the file's established idiom. No production code changed, and no correctness or cross-platform concerns.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Too many files changed for review (209 files, 100 file limit). Bypass the limit by tagging |
4ebfcf6 to
80c9377
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — the deferred-startup and retained-creation machinery fails closed and stays owner-fenced; one minor suggestion inline.
Reviewed changes
Since the prior Pullfrog review (148ee48), this branch merged in the retained-composer-drafts stack (previously stacked PR #18794) plus one E2E test commit.
- Added a daemon/runtime deferred-startup protocol — a held composer command is written to its terminal exactly once, on an explicit
releaseStartupCommand, gated behind daemon protocol v37/v38 and triple-checked (operation + incarnation + owner) at every layer. - Added retained/standby worktree preparation — a single-slot standby owner and a preparation-pool hold/claim keep one warm checkout for the active composer target, with the renderer retaining a frozen request snapshot until submit.
- Extracted hook-trust inspection —
inspectHooksTrustchecks script trust non-interactively without opening the composer's modal. - Refactored child-process spawn resolution —
resolveSpawnmoved to a pure module;hasExitedPosixProcessGroupskips the termination grace when the drained root's group is already gone.
ℹ️ Scope expanded past the title and description
The branch now ships the full retained-composer-drafts + deferred-startup feature (the diff grew from ~43 to 209 files vs main), but the title and "What Changed" section still describe only the technical creation work and claim the composer work is "isolated in stacked PR #18794". Worth reconciling so a reviewer reading the description understands what this PR actually ships — and so the two PRs don't merge the same code twice if #18794 also lands.
ℹ️ Nitpicks
completePreparationClaimonly runs on the finalize-success path inconsumePreparedWorktreeCreate, so a failed finalize leaves the standby slot cold — the standby owner is never notified to re-prepare until the composer target changes.createRetainedWorktreeCreation.retire()is never called in production (retiredis only set insidetake's mismatch branch).
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
src/main/worktree-create-preparation-pool.ts:159(RIGHT) — file not in PR diff
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The branch was rewritten since the prior review: the retained-composer-drafts stack that had been merged in is now split back out into stacked PR #18842, so this PR is again the technical portion only (the prior scope-expansion note and inline nitpicks no longer apply). The remaining new commits are test-only.
- Reaped orphaned macOS Crashpad reporters on teardown — a new
cleanupE2ECrashpadhelper, invoked fromcleanupE2EDaemons, enumeratespson macOS andSIGTERMs only the reporter whose--databasepoints at the exact temporary profile, re-checking ownership with a secondps -pbefore signaling to close the enumeration→kill race. - Tightened the SSH lease assertion — the five-restart loop now asserts the reattachable lease settles at the exact active PTY (
toRelaySshPtyId(targetId, ptyId)) rather than a bare count of one, and waits for the pane's PTY binding to change before sending the generation marker.
The crashpad cleanup is appropriately defensive: it re-verifies the PID still owns the profile database before SIGTERM, is a no-op off darwin, and treats both enumeration and kill failures as best-effort. The unit test pins the ownership recheck (a PID whose command changed after enumeration is not signaled) and the platform gate.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…al' into nwparker/worktree-create-technical
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior Pullfrog review (0575b264) is a merge of current main into the branch — two merge commits that bring the PR current without touching its own code.
- Merged
main79350f455into the branch —b36d2783(mergeorigin/main) followed by18df2f2f(mergeorigin/nwparker/worktree-create-technical). The four main commits pulled in (79350f455e2e sidebar helpers,a3c1d329cloud relay-ops latency bar,9c3d957aautomations collation reuse,062db771tab minimum width) share no file paths with PR-A's 46 files, so the merge is clean. - PR-A technical content is unchanged — the base-OID reuse and read overlap, adoption-first branch probe, async WSL workspace-root resolution, catalog invalidation ordering, snapshot-baseline replay, and ligatures-before-atlas changes all remain exactly as previously reviewed and approved.
One incidental, non-blocking note: the merge surfaces a package.json diff that removes a duplicate bench:terminal-partial-escape-tail key (--disable-warning=MODULE_TYPELESS_PACKAGE_JSON variant) that main's #18764 left behind. No behavioral impact — the later no-flag entry already wins on main.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…ate-technical # Conflicts: # tests/e2e/ssh-docker-transport-drop-recovery.spec.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior Pullfrog review (18df2f2), a single test-only commit de-flakes the real-child self-exit assertion in the Claude stream-json connection suite.
- De-flaked the self-exit tree verdict —
claude-stream-json-connection.test.tsno longer pinsclose()tofalseand the tree tounverifiable, because a real child's stderr-triggered descendant snapshot can now win or lose the race with its own exit. The test still pins the first-hand root verdict (root: 'exited'), accepts onlyexited/unverifiablefor the tree, and assertsclose()agrees with the observed tree verdict (closed === (tree === 'exited')).
The loosened assertion is genuinely racy rather than loose: proveClaudeChildExitWithReaper returns exited && tree.treeVerdict === 'exited', so given root: 'exited' the new consistency check is an exact invariant on the ladder's return expression and still fails on a regression. Deterministic coverage is preserved elsewhere — the adjacent natural-exit test pins tree: 'exited', and claude-agent-sdk-exit-proof.test.ts / claude-agent-sdk-root-kill-fallback.test.ts pin tree: 'unverifiable' with mocked deps.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior Pullfrog review (1b7386f), a merge of current main brought three main commits into the branch, with a single conflict in the SSH transport-drop spec.
- Merged
main1924c8f5b1—aad6d64pulls in1924c8f5b1(sort-comparator perf-lint contracts),d8c4c830(E2E SSH recovery fencing + therecoverDockerSshRelayAfterFaulthelper), and61ebffa86(terminal-wait blocked-prompt bound). None of them touch PR-A production code. - Resolved the lease-test conflict correctly — the five-restart loop in
ssh-docker-transport-drop-recovery.spec.tsnow drives main'srecoverDockerSshRelayAfterFaulthelper while preserving both PR-A guarantees intact: the wait-for-replacement-PTY poll (.poll(...).catch(() => previousPtyId).not.toBe(previousPtyId)) and the exact-PTY assertion (.toEqual([toRelaySshPtyId(remote.targetId, ptyId)])). Theelectron-process-shutdown.tsoverlap auto-merged cleanly, keeping both thecleanupE2ECrashpadhook and main'sreleaseExitedProcessPipes.
The earlier package.json duplicate-bench:terminal-partial-escape-tail note is now moot — main resolved that key itself, so the PR diff no longer carries it.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior Pullfrog review (aad6d64), a single test-only commit adds diagnostic evidence capture around the frozen-host input-recovery test.
- Added an SSH recovery input-observation helper —
attachSshRecoveryInputObservationruns apage.evaluatethat snapshots the store's SSH connection authority (sshConnectionStates.get(targetId)), the active worktree, each pane manager's pane bindings (ptyId, active leaf), and aterminal.listresult raced against a 1s timeout, then attaches the result asssh-input-<label>.json. - Wrapped the frozen-host recovery test with evidence capture — the
accepts input again after a frozen host resumestest now recordsbefore-freeze,after-write, andfailure-before-cleanupobservations, so a flake or failure leaves the recovery state (authority, pane bindings, terminal list) attached to the report instead of vanishing with the torn-down user-data dir.
The helper mirrors the repo's established E2E introspection idioms (window.__store?.getState(), window.__paneManagers, the sshConnectionStates.get(targetId) pattern from ssh-codex-reconnect-replay-driver.ts), is best-effort by design (the failure-path capture is .catch(() => undefined)), and the 1s timeout race keeps a hung terminal.list from stalling the observation. No production code changed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…tablyai#18793) * perf(worktree): remove redundant creation and terminal startup work * test(worktree): cover optimized creation call signatures Preserve explicit branch adoption, WSL callback routing and sparse cleanup expectations. * perf: preserve user Git checkout worker settings * perf(git): skip malformed remote base probes * perf(cli): avoid loading other agent hooks for Codex preflight * fix(build): retain Codex preflight entry for packaged CLI * test(ssh): wait for replacement PTY before lease recovery input * test(ssh): verify recovered shell execution and lease ownership * test(electron): reap isolated macOS crash reporters on teardown * test: allow either observed self-exit snapshot ordering * test: capture frozen-host input recovery evidence

Worktree creation repeats Git checks and terminal setup before the workspace becomes usable. This removes redundant work while preserving the existing creation trigger, branch selection, hooks, profiles, and startup policy.
This is the independent technical foundation for #18876. It adds no speculative workspace, shell, hook, or agent startup. It respects the user's Git checkout-worker configuration.
Evidence:
aad6d64f1d6includes main1924c8f5b1e. Full typecheck passed. The previous integration passed 260 focused tests (17 environment-gated skips); subsequent lifecycle and main-integration checks passed 56 and 26 tests respectively.9df55c82346adds test-only evidence: shell-executed pre-freeze readiness and bounded terminal/authority observations, with the post-recovery observation after the single write. The original 60-second output assertion remains. The final local test passed in 57.8 seconds. Current CI: https://github.com/stablyai/orca/actions/runs/33993416795 — unit/static/typecheck/compatibility/packaging and changed E2E passed (15 passed, 1 skipped; frozen-host input recovery 51.3 s). The broader SSH suite also passed; the full run completed successfully.bebc3d9277ef(A + Keep creation drafts responsive without early workspace shells #18876 + main1924c8f5b1e); subsequent commits change only two E2E test files. ARM installer checksum, app signature/notarization, bundled source, and actual creation/Send/reload behavior verified. Windows checksum verified; Windows UI untested.Merged as
d7767fb1960507a7ae3fc47d5858b06f8887bd6bafter exact-head full CI passed. Assessed merge risk: low; the earlier frozen-host failure remains unexplained, but the corrected test and broad SSH suite pass. Snapshot replay and catalog invalidation are reliability changes, so this is not a pure performance refactor.Remaining user-facing negative trade-off: