Repository navigation
fix(worktree): show setup status for blank creates - #27
Merged
Merged
Conversation
5 of 9 tasks
nplez1
added a commit
that referenced
this pull request
Sep 25, 2026
* fix(worktree): show setup status for blank creates * test(worktree): align setup launch coverage with host spawn
nplez1
added a commit
that referenced
this pull request
Sep 27, 2026
* fix(worktree): show setup status for blank creates * test(worktree): align setup launch coverage with host spawn
nplez1
added a commit
that referenced
this pull request
Sep 29, 2026
* fix(worktree): show setup status for blank creates * test(worktree): align setup launch coverage with host spawn
nplez1
added a commit
that referenced
this pull request
Oct 1, 2026
* fix(worktree): show setup status for blank creates * test(worktree): align setup launch coverage with host spawn
7 of 9 tasks
nplez1
added a commit
that referenced
this pull request
Oct 6, 2026
* fix(worktree): show setup status for blank creates * test(worktree): align setup launch coverage with host spawn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you create a workspace and pick no agent, Orca still runs the repo's setup script (
pnpm install, or whatever the repo declares). While that script runs, the sidebar is supposed to show a pulsing amber Setting up… dot. For a blank create it never did: the workspace went straight to green Active, so one that was still installing looked ready to use. The shell that runs setup was being started by the window instead of by the Orca host, and only the host can watch a setup script and report on it. Now the host starts that first shell and the Setup tab for blank workspaces too, so the dot appears and clears exactly as it does for agent workspaces.What Changed
Before
spawnLocalStartupAndSetupTerminalson its first guard,!startup— with or without configured default tabs — and returneddidSpawnSetup: false, so the host spawned nothing.worktreeSetupRunnerStatewas never announced and the sidebar showed plain green Active for the whole setup. That is the exact state feat(sidebar): show setting up while a repo's setup script runs #19 exists to remove; feat(sidebar): show setting up while a repo's setup script runs #19 only covered creates where the host already spawned a startup terminal, which is why the report was "not working in1.4.197-np.11".After
OSC 133;D/ PTY-exit / watchdog paths.startupTerminal.spawnedon the result and keeps that shell instead of creating a second one, so the no-default-tabs case still ends up with exactly one primary shell and one Setup tab rather than two of either.The mechanism is a rewritten gate plus one fallback shell:
src/main/ipc/worktree-remote.ts:408-412):canSpawnSetupWithoutStartupis true when there is a setup launch and either there are no default tabs, or setup runs in its own tab. Nothing else moved — an agent create with configured default tabs still bails, and a create with no setup script still bails.else if (setup && !hasDefaultTabs)(:474-479) spawns the fallback primary shell withactivate: trueand records it asstartupTerminal. That record is what makes the renderer treat the host as the owner of the tab (src/renderer/src/lib/worktree-initial-terminal-seeding.ts:100-120).armWorktreeSetupRunnerare untouched; the blank case now reaches them. If the host fails to spawn setup,didSpawnSetupstays false and the result still carriessetup, so the renderer's existing retry path runs unchanged.worktrees-setup-launch-sparse-checkout.test.tsasserted that the create returns asetuppayload for the renderer to launch. They now assert the host spawn andexpect(result).not.toHaveProperty('setup'), which is the behavior change stated as a test.Also in this diff: a two-line correction to
quick-open-file-list.react.test.tsx, unrelated to the setup path — itsonStateprobe was a no-op function, so thestates.at(-1)?.filesassertion it guards could never hold. Folded in to get this PR's CI green.Why
OSC 133;D, PTY exit) is readable on the PTY the host created. A renderer that queued the command has no handle and no end signal, so a dot it set itself would either stick or need a timer — the stuck-dot failure mode feat(sidebar): show setting up while a repo's setup script runs #19 was built to avoid. This is also the rule indocs/reference/agent-status-store.md: the execution host owns status, and readers keep only presentation policy.provisionWorktreeTerminals(src/main/runtime/runtime-worktree-terminal-provisioning.ts:104-106) already spawns a fallback primary terminal when there is no startup terminal and no default tab, then arms the runner. The local IPC path did not, and that divergence is what the reported build showed. This brings the local path into line with the runtime one.Linked Issue
N/A — no tracking issue. GitHub issues are disabled on this fork (
nplez1/orca), and a search of upstreamstablyai/orcaissues found no matching report, so there is nothing to link. Reported directly: the setup-running indicator never appeared in1.4.197-np.11.Visual Proof
Not provided — no capture, and the app was not run for this change. This is a waiver rather than an
N/A: the template reserves a bareN/Afor a change with no visible effect, and this one has one — the sidebar status lane gains the pulsing amber dot #19 added, for a case that previously stayed green. The$electronskill this repo'sAGENTS.mdnames for rendered-UI checks is not installed in this worktree (the installed skills arecomputer-use,find-skills,orca-cli, andorchestration), and no1.4.197-np.11-equivalent build was run against a repo with a slow setup script, so there is nothing to attach.Stated instead — and all of it is the indicator #19 already renders, not new pixels:
worktrees-local-create-flow.test.tschecks that the host spawns the shell and the Setup tab and callsarmWorktreeSetupRunner. The dot's rendering is already covered by feat(sidebar): show setting up while a repo's setup script runs #19'sStatusIndicator.test.ts.Testing
pnpm teston the four touched suites —worktrees-local-create-flow,worktrees-setup-launch-sparse-checkout,worktree-activation-setup-script,quick-open-file-list.react— 60 passed. Covers the new blank-create case (spawn order, observed Setup command,armWorktreeSetupRunner, nosetupechoed back,startupTerminal.spawned), the two updated cases that previously asserted the renderer-queued payload, and the renderer case that a backend-spawned shell plus Setup tab is kept rather than duplicated.pnpm test src/main/runtime/orca-runtime.test.ts— 1,298 passed, 1 skipped (the adjacent provisioning/host suite).pnpm tc— clean (main, node, web, cli).pnpm run check:code-quality:changed— 0 new findings across the 5 changed files (casting, focused plugins, type-aware, React Doctor, design system, casting-SAFETY), gate passed since1f6cbb2603.Fails without the fix: with only
src/main/ipc/worktree-remote.tsreverted toorigin/nplez1/main,worktrees-local-create-flow.test.tsfails withexpected "vi.fn()" to be called 2 times, but got 0 times— the host spawned no terminal at all for a blank create — and two cases inworktrees-setup-launch-sparse-checkout.test.tsfail too, because they had encoded the old payload. All pass with the change.CI on
d55e74f10d: 17 checks pass, 12 skip, none fail.Not run: full
pnpm testandpnpm build. The suites above were run on macOS; the app itself was not run on any platform.I manually tested these changes locally
Automated tests added/updated, or explained why not below
No manual run: the missing state was located and verified at the create handler and the renderer seeding function, which is where it came from. Manual steps for a reviewer: add a workspace with no agent to a repo whose setup script sleeps ~20s → the dot should pulse amber and then clear; Ctrl+C in the Setup tab mid-run → the dot should clear immediately.
AI Disclosure
Authored with an AI coding agent (pi,
gpt-6-luna) under human direction, and verified against the repo gates and the failure mode above. This description was written by a later pi session (deepseek-flash) from the branch diff.Review
Start with
spawnLocalStartupAndSetupTerminalsinsrc/main/ipc/worktree-remote.ts(:398-479): the rewritten gate and the new fallback-shell branch are the whole fix, and the two cases that must still bail are an agent create withdefaultTabsand any create without a setup script. Then the renderer half,src/renderer/src/lib/worktree-initial-terminal-seeding.ts:100-120, which decides fromstartupTerminal.spawnedthat the host already owns the shell. The tests are the contract:worktrees-local-create-flow.test.tsand the updatedworktrees-setup-launch-sparse-checkout.test.tsfor the host,worktree-activation-setup-script.test.tsfor the renderer.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
worktreeSetupRunnerStatehost→client event, which carries a worktree id and a boolean. No path handling or shell interpolation is added; the runner command comes from the samebuildObservedSetupCommand/buildSetupRunnerCommandhelpers the agent path already uses.createTerminaloptions the startup path uses, and the observed-command wrapper already has its PowerShell andcmd.exebranches. Not manually tested on Windows or Linux; the change is gate logic plus onecreateTerminalcall.createRemoteWorktree, which never spawned setup host-side and still returns the runner to the client — the reason feat(sidebar): show setting up while a repo's setup script runs #19 left the SSH dot green. A paired-host create goes throughcreateRuntimeRemoteManagedWorktree, which is untouched: its headless branch already provisions and arms, while its interactive branch with no startup still hands the runner back to the client, so that path keeps today's behavior. The confirmed repro was local, so this PR does not widen scope there.runtime-folder-worktree-create.tsis a separate path, and this function is keyed to a worktree.startupTerminalwas already optional and is already read asbackendStartupTerminalSpawned). No persisted state, no stored setting, no wire change; a paired client that predates it reads the optional field exactly as before.setupScriptLaunchModeset to a split, with configureddefaultTabsand no agent, still takes the renderer-queued path (the gate still bails, because that split needs a primary pane and the renderer owns the tabs in that case). Arming it would mean spawning a host primary alongside the renderer's default tabs — a second terminal for a corner case.Checklist
N/Awith reason — not captured; see Visual Proofpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) —pnpm tc, the three suites above, and the changed-code quality gate pass locally; fullpnpm testandpnpm buildare left to CI