Skip to content

fix(remote): resolve the spawn cwd, the node manager dir, the vault host and the scrollback seed - #17952

Merged
nwparker merged 2 commits into
mainfrom
fix/remote-environment-resolution
Sep 3, 2026
Merged

nwparker merged 2 commits into
mainfrom
fix/remote-environment-resolution

Conversation

@nwparker

@nwparker nwparker commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​474 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​460
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​245 $\color{#cf222e}{\Huge{\mathbf{−}}}$​88 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​157

Four issues where a remote environment detail was resolved wrongly. Three are substitution-on-absence — the pattern #17945 and #17948 have been closing: a client-side or unresolvable answer treated as licence to pick a default.

#15296 — an agent spawning in $HOME instead of the workspace

pty-handler.ts:1626 and :1726 both did params.cwd || resolveDefaultCwd(), and resolveDefaultCwd returns $HOME. When the client sends no explicit cwd, the relay had two other pieces of workspace identity in the same request and consulted neither: worktreeId and env.ORCA_WORKSPACE_ROOT. And splitWorktreeId returns null for a folder:<uuid> id — no :: — so a folder workspace has no path anywhere in the relay's reach and $HOME won silently.

The client does deliver the root: ORCA_WORKSPACE_ROOT is set on both spawn paths and survives to the relay through buildSshPtySpawnEnv, which strips nothing.

New resolveRelaySpawnCwd, called from a single helper used by both the admission fence and the native spawn — so the fence can never be keyed on a directory the spawn will not use. Order: explicit cwd → worktree path (via splitWorktreeIdForFilesystem, which strips the ::workspace:<uuid> suffix — the #17948 collision) → ORCA_WORKSPACE_ROOT → host default. Existence is checked on the relay host, because the relay is the execution host.

The refusal is deliberately narrow: when a folder workspace names a root that does not resolve here and the spawn carries launchAgent, the relay throws rather than spawning. A worktree path absent on the relay host (a Windows relay launching into WSL, where the wrapper owns the cd) still falls through as before, and a plain shell is never refused. Only the agent case — the one that can do real damage — refuses.

BEFORE  × spawns a folder workspace in ORCA_WORKSPACE_ROOT instead of the host default
          expected '/Users/nwparker' to be '…/workspace'
        × refuses to launch an agent when the named workspace root is not on this host
        × refuses to launch an agent for a folder workspace that carries no root at all
        × falls back to the worktree path carried by the worktree id
        Tests  4 failed | 3 passed (7)
AFTER   Tests  7 passed (7)

Honest caveat: the reporter's exact fallback directory was not reproduced — their OLDPWD/PWD evidence is also consistent with a login shell's own rc cd-ing after a correct spawn. The code defect they name is real and is what is fixed. Also noted, not fixed: createDesktopTerminal lacks the ?? workspace.path fallback its background sibling has, a latent second source of an undefined cwd that the renderer currently covers.

#11733 — MISE_DATA_DIR appeared nowhere in the repo

NVM was the only manager whose custom directory was honoured — it read ${NVM_DIR:-…} and scraped NVM_DIR= out of five dotfiles. mise got two hardcoded $HOME/.local/share/mise/… lines.

The dotfile scrape is the load-bearing half: the probe runs over sshd's exec channel under /bin/sh -c with no profile sourced, so a bare ${MISE_DATA_DIR:-…} would have no-opped for the reporter — it is set in their ~/.zshrc, which that shell never reads.

Generalised the NVM scrape into a POSIX orca_dotfile_dirs <VAR> <seed> function reused by both managers rather than duplicated, and drove mise off ${MISE_DATA_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/mise} plus the scrape.

BEFORE  Tests  5 failed | 34 passed (39)
AFTER   Tests  39 passed (39)

Three of those tests write a real fake node into a tmp HOME and execute the generated script through /bin/sh. Left alone but worth filing: the local resolver has the identical hardcode, and the login-shell fallback takes stdout.split('\n')[0] with no banner fencing — the SSH analogue of buildWslCapturedLoginShellCommand, which has no SSH equivalent.

#13713 — the title is a paraphrase; it is the AI Vault empty state

The string in the screenshot is the AI Vault empty state, not a terminal error. ai-vault-host-scope.ts:39 did activeExecutionHostScope ?? LOCAL_EXECUTION_HOST_ID, and the resolver returns null when the worktree is missing from the client's worktreesByRepo index. That registry is client-side, so its silence is unverifiable — but it was coerced to local, and main then scanned the desktop's own ~/.claude. A user whose sessions all live on an SSH box gets a clean, error-free, banner-free empty list.

Now "no workspace selected" keeps local; "workspace named, host unresolvable" defaults to ALL_EXECUTION_HOSTS_SCOPE, which already fans out to every host. Self-corrects once the store hydrates.

The thread's own theory was ruled out: isRemoteSessionInScope cannot cause this — scopePaths is purely additive on top of an unscoped recency top-N, so a scope mismatch can hide old sessions but never produce zero.

Also noted: the empty state guards on !error but not on blockingAiVaultScanIssue, so a real "relay not ready" renders as both a banner and "No agent sessions found" — which is what makes this class near-undiagnosable from a screenshot.

#6106 — an option that did the opposite of its documented purpose

pane-serializer-register.ts:46 produced { scrollback: 0 } when altScreenForcesZeroRows was set and the pane was on the alternate screen. But SerializeAddon emits the normal buffer honouring scrollback and then appends ?1049h plus the alt buffer, and readers split them apart again. So scrollback: 0 never suppressed "transient TUI bytes" — it dropped precisely the normal-buffer shell history the seed exists to carry.

Hydration re-arms on model dispose/demote, both of which fire on SSH attach, so a re-hydration while Codex is on the alt screen permanently strips pre-TUI scrollback from main's model. Every later hidden restore then legitimately paints only the TUI.

The serializer now always honours scrollbackRows, and the meaningless flag is removed end-to-end — renderer opts, runtime contract, preload/IPC shape, all four call sites — so nothing is left claiming an option that no longer exists.

BEFORE  × keeps pre-TUI shell scrollback when hydrating from a renderer on the alternate screen
          expected '…?1049h…Codex T…' to contain 'PRE_CODEX_START'
        Tests  2 failed | 1219 passed
AFTER   Tests  1221 passed | 1 skipped (1222)

Two further contributors not touched, both larger: the relay-replay fallback emits CSI 3 J (which erases xterm's scrollback) before rewriting only the 100 KiB tail; and the remote-runtime wire folds scrollbackAnsi into data and never transmits it — a capability-negotiated wire change.

Verification

full sweep of touched areas      15,446 passed | 27 skipped | 0 failed
pnpm tc:node / pnpm tc:web       clean
check:code-quality:changed       0 new findings across 24 files
sync:localization-catalog        no diff

Fixes #15296, #11733, #13713, #6106

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: c5102c79-075d-4ec7-b0ed-aca6e6d46da4

📥 Commits

Reviewing files that changed from the base of the PR and between 40d9927 and 8f04715.

📒 Files selected for processing (25)
  • src/main/ipc/pty-buffer-snapshot-dispatch.test.ts
  • src/main/ipc/pty/ipc/serialize-buffer.ts
  • src/main/ipc/pty/runtime/controller-deps.ts
  • src/main/ipc/pty/runtime/operations.ts
  • src/main/ipc/pty/session.ts
  • src/main/runtime/orca-runtime-maybe-hydrate-headless-from-renderer.ts
  • src/main/runtime/orca-runtime-serialize-terminal-buffer-from-available-state.ts
  • src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts
  • src/main/runtime/orca-runtime-visible-snapshot-preview.ts
  • src/main/runtime/runtime-pty-controller-contract.ts
  • src/main/ssh/ssh-remote-node-probe-script.ts
  • src/main/ssh/ssh-remote-node-resolution.test.ts
  • src/main/ssh/ssh-remote-node-resolution.ts
  • src/preload/api/pty-api.ts
  • src/preload/api/pty-bridge-stream-and-serialization.ts
  • src/relay/pty-handler-spawn-admission.test.ts
  • src/relay/pty-handler-spawn-cwd.test.ts
  • src/relay/pty-handler.ts
  • src/relay/pty-spawn-cwd.ts
  • src/renderer/src/components/right-sidebar/ai-vault-host-scope.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-host-scope.ts
  • src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts
📝 Walkthrough

Walkthrough

The change removes altScreenForcesZeroRows from terminal serialization contracts and preserves pre-TUI scrollback during snapshots. It extracts and extends the SSH Node path probe for mise and dotfile configuration. It centralizes relay PTY working-directory resolution and rejects unresolved agent directories. It changes execution-host scope fallback for named workspaces with unresolved hosts. Tests cover the updated serialization, Node discovery, PTY spawning, and host-scope behavior.

Merge Risk: 🟡 Moderate · up to cab2f

The PR improves remote workspace and terminal handling, but agent launches may still be blocked for valid worktree setups when the workspace path is unavailable on the relay host. Request-derived working directories also lack demonstrated ownership or containment checks, leaving a bounded security risk. Merge should wait for the launch-refusal fix and explicit path-authorization confirmation.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes three substantial fixes unrelated to the only directly linked issue [#15296]: mise directory resolution, AI Vault host scoping, and alternate-screen scrollback handling. Link issues #11733, #13713, and #6106 as direct objectives for this PR, or move those changes into separate pull requests. If the PR remains scoped only to #15296, remove the unrelated changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 23 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the four primary fixes: remote spawn CWD, node manager directory resolution, vault host scope, and scrollback seeding.
Description check ✅ Passed The description is detailed and covers the changes, rationale, linked issues, implementation notes, caveats, and verification results. It does not use all template headings or provide visual proof, bu…
Linked Issues check ✅ Passed The changes satisfy issue [#15296] by preserving worktree-path resolution, using an existing ORCA_WORKSPACE_ROOT for folder workspaces, and retaining a generic fallback when appropriate.
Full details: Description check

Explanation

The description is detailed and covers the changes, rationale, linked issues, implementation notes, caveats, and verification results. It does not use all template headings or provide visual proof, but the core required information is present.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 009948b1-4d97-4fea-8f16-e3ef54a58ae4

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa02ea and cab2fb1.

📒 Files selected for processing (24)
  • src/main/ipc/pty-buffer-snapshot-dispatch.test.ts
  • src/main/ipc/pty/ipc/serialize-buffer.ts
  • src/main/ipc/pty/runtime/controller-deps.ts
  • src/main/ipc/pty/runtime/operations.ts
  • src/main/ipc/pty/session.ts
  • src/main/runtime/orca-runtime-maybe-hydrate-headless-from-renderer.ts
  • src/main/runtime/orca-runtime-serialize-terminal-buffer-from-available-state.ts
  • src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts
  • src/main/runtime/orca-runtime-visible-snapshot-preview.ts
  • src/main/runtime/runtime-pty-controller-contract.ts
  • src/main/ssh/ssh-remote-node-probe-script.ts
  • src/main/ssh/ssh-remote-node-resolution.test.ts
  • src/main/ssh/ssh-remote-node-resolution.ts
  • src/preload/api/pty-api.ts
  • src/preload/api/pty-bridge-part-2.ts
  • src/relay/pty-handler-spawn-cwd.test.ts
  • src/relay/pty-handler.ts
  • src/relay/pty-spawn-cwd.ts
  • src/renderer/src/components/right-sidebar/ai-vault-host-scope.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-host-scope.ts
  • src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment thread src/relay/pty-spawn-cwd.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Relay spawn cwd (#15296) — resolveRelaySpawnCwd in src/relay/pty-spawn-cwd.ts resolves explicit cwd → worktree path (via splitWorktreeIdForFilesystem) → ORCA_WORKSPACE_ROOT → host default, with existence checked on the relay host. A single requireRelaySpawnCwd helper feeds both the admission fence and the native spawn, so the two can never disagree on the directory. The refusal is correctly narrow: only a TUI-agent spawn for a folder workspace whose root is absent/unavailable on the relay throws; plain shells and missing worktree paths (Windows relay → WSL) still fall through to the host default.
  • mise Node discovery (#11733) — the NVM dotfile scrape is generalized into a parameterized orca_dotfile_dirs in ssh-remote-node-probe-script.ts, and mise is now driven off ${MISE_DATA_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/mise} plus the scrape. The extracted script is exercised end-to-end through /bin/sh against a fake HOME in the tests.
  • AI Vault host scope (#13713) — useAiVaultExecutionHostScope now defaults an unresolvable workspace host to ALL_EXECUTION_HOSTS_SCOPE instead of local, while no-workspace and local cases are unchanged; the effect self-corrects once the store hydrates.
  • Scrollback seed (#6106) — altScreenForcesZeroRows is removed end-to-end (renderer opts, IPC/preload shape, runtime contract, all four call sites), so the serializer always honors scrollbackRows and hydration no longer drops the pre-TUI shell history.

I traced each branch of the cwd resolver against its tests (folder root present/absent, worktree path present, no workspace, explicit cwd, plain-shell fallthrough), verified the folder:/worktree:/plain-id parsing paths, and confirmed the altScreenForcesZeroRows removal left no prod references behind. The changes are coherent, the refusal semantics match the documented intent, and the tests exercise the real paths rather than asserting trivially.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog

pullfrog Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

…rollback honestly

#15296 relay: a folder workspace id (`folder:<uuid>`) carries no path, so the
worktree-id split yielded nothing and $HOME silently won. Resolve the spawn cwd
through worktreeId -> ORCA_WORKSPACE_ROOT -> host default, and refuse an agent
spawn outright when a folder workspace names a root this host cannot resolve.

#11733 ssh: generalize the NVM dotfile scrape into `orca_dotfile_dirs` and drive
mise off `MISE_DATA_DIR` / `XDG_DATA_HOME` instead of a hardcoded
`$HOME/.local/share/mise`.

#13713 ai-vault: an unresolvable workspace host is `unverifiable`, not local.
Widen the default scope to every host rather than scanning the client's own
history and reporting "No agent sessions found".

#6106 terminal: hydration asked the renderer for `scrollback: 0` while an
alt-screen TUI was up, which drops the normal buffer's shell history rather than
the TUI bytes. Drop the flag; readers already split the two buffers apart.
…ution host

Three findings from review of the spawn-cwd resolver, all the same shape: a path
question answered against the wrong host, or with the wrong key.

- resolveRelaySpawnCwd refused an agent launch whenever a folder workspace named
  a root that did not stat on the relay. But relayHostDirectoryExists stats the
  relay's *own* filesystem, and the relay supports WSL shells, so a folder
  workspace on a Windows relay launching into WSL now threw where it previously
  spawned -- contradicting the function's own doc comment, which says an absent
  path for that exact host pair is a miss, not a refusal. Thread the shell's
  execution host in and demote the refusal to a miss when the spawn does not run
  on the relay's filesystem.

- requireRelaySpawnCwd's doc claims both call sites route through one resolver
  so the fence can never be keyed on a directory the spawn won't use, but the
  fence key was still computed with the non-stripping splitWorktreeId while the
  cwd used splitWorktreeIdForFilesystem. For a `::workspace:<uuid>` id those
  disagree by construction, in adjacent lines: the removal fence guarded a path
  no spawn ever enters. Same defect in shutdownForWorktreePath and the revive
  path; all three now use the filesystem split.

- The remote Node probe expanded `$HOME` and `~/` prefixes out of a dotfile
  assignment but not `$XDG_DATA_HOME`, so `MISE_DATA_DIR=$XDG_DATA_HOME/...`
  was used as a literal directory name. Add the case arm, defaulting to the
  POSIX `$HOME/.local/share` the seed value already uses -- sshd's exec channel
  usually has no XDG_DATA_HOME at all.
@nwparker
nwparker force-pushed the fix/remote-environment-resolution branch from cab2fb1 to 8f04715 Compare September 3, 2026 03:17

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Since the prior review the branch was rebased and one refinement commit (8f04715) landed on top of the original work.

  • WSL guest execution-host demotion — resolveRelaySpawnCwd gained an executesOnRelayFilesystem flag. When the resolved shell is WSL (isRelayWslShell), the relay's own statSync cannot see a guest path, so the agent refusal is demoted to a miss rather than failing an agent launch the wsl.exe wrapper would have cd-ed into correctly. resolveRelaySpawnShell mirrors spawnAfterAdmission's shell resolution (non-throwing on unsupported overrides, which fail the spawn later anyway).
  • splitWorktreeIdForFilesystem fence unification — fence bookkeeping in getPtysByWorktreePath, spawnAfterAdmission, and revive now uses the filesystem split everywhere, so the admission fence is keyed on the same directory the spawn enters rather than a ::workspace:<uuid> instance suffix.
  • $XDG_DATA_HOME dotfile expansion — orca_dotfile_dirs now expands an unbraced $XDG_DATA_HOME assignment (e.g. export MISE_DATA_DIR=$XDG_DATA_HOME/custom-mise) to ${XDG_DATA_HOME:-$HOME/.local/share}/custom-mise; braced forms already expand naturally.
  • isFlattenedNodePtyLoaderMessage cleanup and the pty-bridge-part-2.ts → pty-bridge-stream-and-serialization.ts rename — no behavior change.

I traced the WSL demotion against windows-shell-args.ts (which returns Windows home as the effective cwd and injects the Linux cd into wsl.exe shellArgs), confirmed resolveRelaySpawnShell matches the spawn path's shell resolution, and verified the $XDG_DATA_HOME case order and fallback against the two new /bin/sh-executed tests. The demotion is narrowly scoped (only the refusal case, only when a TUI agent is present), and explicit cwd still short-circuits before any host-filesystem question.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker

nwparker commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (40d9927); the reported merge conflict was stale and the rebase applied cleanly. en.json is untouched by this branch.

The one failing check was pullfrog, which ran for 1h00m and looks like a timeout — every substantive check (typecheck, all 8 test shards, static analysis, package on both platforms, SSH docker watcher isolation) passed.

Three findings addressed in 8f04715, all the same shape: a path question answered against the wrong host, or with the wrong key.

1. pty-spawn-cwd.ts:70 — the host-blind defect, one level down

CodeRabbit's stated case (a normal worktree on a Windows relay would refuse) does not reproduce: reaching line 70 requires ORCA_WORKSPACE_ROOT, which is only ever set for folder workspaces.

But folder workspaces genuinely do refuse, for exactly the host reason the function's own doc comment says should be a miss. The relay supports WSL shells; relayHostDirectoryExists is a statSync against the relay's own filesystem; a guest path never stats on a Windows relay. So an agent launch into a folder workspace on a Windows relay targeting WSL now throws where it previously spawned.

This is the relay assuming its own filesystem is the execution host when a WSL guest may be. CodeRabbit's proposed scope?.type === 'folder' narrowing would not have fixed it — folder scope is precisely when it fires.

resolveRelaySpawnCwd now takes executesOnRelayFilesystem, and demotes the refusal to a miss when the spawn will not run on the relay's own filesystem. pty-handler derives it from the resolved shell via isRelayWslShell, using the same shell resolution spawnAfterAdmission uses.

2. The fence key and the cwd disagreed by construction, in adjacent lines

requireRelaySpawnCwd's doc claims both call sites route through one resolver "so the fence can never be keyed on a directory the spawn won't use". They did not: pty-handler.ts computed the fence's other key with the non-stripping splitWorktreeId while the cwd used splitWorktreeIdForFilesystem. For a ::workspace:<uuid> id those disagree deterministically — the worktree-removal fence guarded a path no spawn ever enters.

Same defect at two more sites, shutdownForWorktreePath and the revive path; all three now use the filesystem split.

3. ssh-remote-node-probe-script.ts:25 — XDG expansion

Added the missing case arm. Detail in the inline reply.

Verification

pnpm tc clean. Changed-code quality gate: 0 findings across 24 files. Each fix has a test that fails on the previous revision — the WSL spawn-cwd test, the fence-key test, and both XDG tests.

@nwparker
nwparker merged commit 57681ec into main Sep 3, 2026
59 of 62 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ost and the scrollback seed (stablyai#17952)

* fix(remote): resolve workspace cwd, mise Node, host scope, and TUI scrollback honestly

stablyai#15296 relay: a folder workspace id (`folder:<uuid>`) carries no path, so the
worktree-id split yielded nothing and $HOME silently won. Resolve the spawn cwd
through worktreeId -> ORCA_WORKSPACE_ROOT -> host default, and refuse an agent
spawn outright when a folder workspace names a root this host cannot resolve.

stablyai#11733 ssh: generalize the NVM dotfile scrape into `orca_dotfile_dirs` and drive
mise off `MISE_DATA_DIR` / `XDG_DATA_HOME` instead of a hardcoded
`$HOME/.local/share/mise`.

stablyai#13713 ai-vault: an unresolvable workspace host is `unverifiable`, not local.
Widen the default scope to every host rather than scanning the client's own
history and reporting "No agent sessions found".

stablyai#6106 terminal: hydration asked the renderer for `scrollback: 0` while an
alt-screen TUI was up, which drops the normal buffer's shell history rather than
the TUI bytes. Drop the flag; readers already split the two buffers apart.

* fix(remote): stop the relay answering host questions for a guest execution host

Three findings from review of the spawn-cwd resolver, all the same shape: a path
question answered against the wrong host, or with the wrong key.

- resolveRelaySpawnCwd refused an agent launch whenever a folder workspace named
  a root that did not stat on the relay. But relayHostDirectoryExists stats the
  relay's *own* filesystem, and the relay supports WSL shells, so a folder
  workspace on a Windows relay launching into WSL now threw where it previously
  spawned -- contradicting the function's own doc comment, which says an absent
  path for that exact host pair is a miss, not a refusal. Thread the shell's
  execution host in and demote the refusal to a miss when the spawn does not run
  on the relay's filesystem.

- requireRelaySpawnCwd's doc claims both call sites route through one resolver
  so the fence can never be keyed on a directory the spawn won't use, but the
  fence key was still computed with the non-stripping splitWorktreeId while the
  cwd used splitWorktreeIdForFilesystem. For a `::workspace:<uuid>` id those
  disagree by construction, in adjacent lines: the removal fence guarded a path
  no spawn ever enters. Same defect in shutdownForWorktreePath and the revive
  path; all three now use the filesystem split.

- The remote Node probe expanded `$HOME` and `~/` prefixes out of a dotfile
  assignment but not `$XDG_DATA_HOME`, so `MISE_DATA_DIR=$XDG_DATA_HOME/...`
  was used as a literal directory name. Add the case arm, defaulting to the
  POSIX `$HOME/.local/share` the seed value already uses -- sshd's exec channel
  usually has no XDG_DATA_HOME at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant