Repository navigation
Labels
os:macosIssues affecting macOS
Description
Operating system
macOS
Orca version
1.4.120
Details
Short summary:
In one of my workspaces, every attempt to open a new terminal from the UI fails with a red toast at the bottom of the window: Terminal cwd must be inside the selected worktree. No terminal is created, and the toast reappears on every retry (it has been reproducing for hours). Creating a terminal in the same workspace via the CLI works fine.
What happened?
- The workspace is a local git worktree managed by Orca at
~/orca/workspaces/nakamuramotoki/Fableと議論(note: display name / branch / path contain non-ASCII Japanese characters — unclear if relevant). It has three Claude Code agent sessions running in terminal panes. - Any attempt to open a new terminal in this workspace shows the red
TerminalErrorToastwithTerminal cwd must be inside the selected worktree.and the "file an issue" link (hence this issue). - The toast recurs every time; the workspace is effectively unable to open new terminals from the UI.
What I dug up (from app.asar of 1.4.120):
- The message is thrown by
resolveTerminalStartupCwdinout/shared/terminal-startup-cwd.jswhen the spawn's requestedcwdfailsisPathInsideOrEqual(worktreePath, resolvedCwd). The failing call path is thepty:spawnIPC handler →resolveGuardedPtySpawnCwd. - So for a plain user-initiated "new terminal", the renderer is passing some non-empty
cwdthat falls outside the selected worktree. I could not determine the offending value: the rejection is not logged anywhere (checkedlogs/main.trace.ndjson— no occurrence of the message), it only surfaces in the toast. - The worktree path resolution itself is fine:
orca terminal create --worktree activefrom the CLI (which omitscwd) succeeds in the same workspace. - The live cwd of every existing pane shell in the workspace is inside the worktree (verified via
lsof -d cwdon the pane shells), so the bad value is presumably a persisted/tracked one (terminal tabs persiststartupCwdin the session schema) rather than the current state of any live pane.
How can we reproduce it?
I don't have a from-scratch recipe, but the failing state is fully reproducible on my machine:
- Workspace = local git worktree (non-ASCII path) with Claude Code agent sessions running in its panes.
- Try to open a new terminal in that workspace from the UI.
- Red toast
Terminal cwd must be inside the selected worktree.appears and no terminal is created — every time.
Expected behavior / suggestions:
- A user-initiated "new terminal" should never hard-fail on the cwd guard: if the remembered/inherited cwd is outside the selected worktree, fall back to the worktree root instead of refusing to create the terminal. (The guard makes sense for remote/session clients per the code comment, but for the local UI path it turns a stale value into a persistent, unrecoverable failure.)
- Log (or show) the rejected cwd value. Right now the error gives no hint which path was rejected nor how to clear it, so there is no way for a user to self-recover.
Anything else that might help:
- Orca 1.4.120 (production build), macOS 26.5.2 (arm64), local runtime (no SSH/remote pairing involved).
- Agent panes are Claude Code 2.1.19x, which uses its new daemon/bg-pty-host architecture (the
claudeprocess in the pane is a thin client; the actual session process is a child of aclaude daemonprocess detached from the pane) — mentioning it in case the cwd tracking interacts with that. - Workaround that works for me:
orca terminal create --worktree active --jsonfrom the CLI inside the worktree.
Reacted by AliuQ
Activity
aliuq commentedon Jul 7, 2026
Version 1.4.126 still has this issue, and it obscures the normal terminal display.
Shoma-DS commentedon Jul 8, 2026
Additional repro from another workspace.
/Users/deguchishouma/Desktop/AI法人研修term_7113083a-8f05-4b4c-9033-0bc0434b09baThe selected terminal/workspace appears to be inside the selected worktree:
However, trying to inspect that terminal through the CLI fails because the runtime becomes unavailable:
I also saw a related stale runtime state:
orca status --jsoninitially reportedapp.running: false,runtime.state: stale_bootstrap,reachable: false.orca open --jsonreturnedapp.running: true,runtime.state: ready,reachable: true.orca terminal show/read/listreturnedruntime_unavailableagain.orca status --jsonreportedapp.running: false,runtime.state: stale_bootstrap,reachable: false.ps -p <pid>still showed/Applications/Orca.app/Contents/MacOS/Orcarunning.So in this case the toast is shown even though the cwd/git root are inside the worktree, and the CLI/runtime connection also seems to get into a stale bootstrap state while the app process remains alive.
nwparker commentedon Jul 8, 2026
Looking now!
nwparker commentedon Jul 8, 2026
Getting a fix in today
fix: recover fresh local terminal spawns from a deleted saved cwd
fix: recover fresh local terminal spawns from a deleted saved cwd (#7847
nwparker commentedon Jul 8, 2026
This is now fixed, in two parts:
Terminal cwd must be inside the selected worktree.) was eliminated by fix(terminal): allow terminals to spawn outside the worktree (#7685) #7750, which removed the startup-cwd containment guard entirely — a terminal now spawns at the requested folder even when it's outside the worktree. That shipped in v1.4.128.@aliuq — 1.4.126 predates both fixes; updating to v1.4.128 or later removes the toast you hit, and the deleted-folder recovery lands in the release after this merge.
@Shoma-DS — your rejection happened on 1.4.121, before #7750, so the same upgrade applies. The
orca statusflapping you captured (stale_bootstrap/runtime_unavailablewhile the app process is alive) is a separate bug from the cwd guard — I've split it out into #7848 with your data so it doesn't get lost when this closes.Thanks for the unusually detailed reports — the app.asar spelunking in the original report pointed straight at the failing call path.
fix: recover fresh local terminal spawns from a deleted saved cwd (st…