orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: WSL orca-ide CLI loses cwd when Windows cmd.exe falls back from UNC path

Open euclodius opened this issue 5 months ago • 1 comments

Operating system

Windows + WSL (Ubuntu 24.04)

Orca version

1.4.111

Details

Problem or use case:
The WSL-installed orca-ide CLI shim still starts the Windows side from a WSL UNC current directory. cmd.exe cannot use that UNC path as its current directory, falls back to C:\Windows, and selector-based CLI commands then resolve the current directory incorrectly.

This is still reproducible after updating to Orca 1.4.111.

Example from a WSL shell inside an Orca-managed WSL Git project:

cd /home/<user>/projects/<repo>
orca-ide worktree current --json

Observed output shape:

"\\wsl.localhost\Ubuntu-24.04\home\<user>\projects\<repo>"
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
{
  "id": "local",
  "ok": false,
  "error": {
    "code": "selector_not_found",
    "message": "No Orca-managed worktree contains the current directory: C:\\Windows"
  },
  "_meta": {
    "runtimeId": null
  }
}

The same warning is also printed by commands that otherwise succeed, for example:

orca-ide status --json

Observed behavior:

  • orca-ide status --json can still reach the app/runtime, but prints the UNC/cmd warning first.
  • orca-ide worktree current --json fails because Orca sees the current directory as C:\Windows instead of the WSL project directory.
  • In localized Windows environments, the same cmd.exe warning is printed localized, and can also appear as mojibake inside Orca terminal previews.

Expected behavior:
The WSL orca-ide shim should preserve or translate the WSL current directory before invoking the Windows side, so selector-based commands such as worktree current resolve /home/<user>/projects/<repo> instead of C:\Windows.

Notes:
This looks related to stablyai/orca#6331 / stablyai/orca#6536, but not fully covered by that fix. stablyai/orca#6536 fixed opening WSL workspaces whose worktree is a \\wsl.localhost\... UNC path by making PTY working-directory validation WSL-aware. This issue is specifically about the WSL CLI shim / Windows cmd.exe launch path for orca-ide, where cmd.exe still starts with a WSL UNC cwd and falls back to C:\Windows before selector-based CLI commands run.

euclodius avatar Jul 01 '26 00:07 euclodius

Cross-linking related WSL agent-detection/status reports: #7563, #6907, and #7565.

The UNC/cwd fallback here is a separate bridge bug, but it appears to interact with the same broader Windows desktop app + WSL runtime boundary. In #7563, the reporter notes that locally fixing the active/current cwd resolution was enough to make CLI selectors work, but it did not fix GUI agent detection. In #7565, explicit terminal identity/env is present for WSL-launched OMP agents, but the GUI sidebar still does not show them.

So this issue may be necessary but not sufficient for the agent symptoms: fixing the WSL CLI cwd bridge should help active/current selectors, while GUI agent detection/projection likely needs its own WSL-runtime test coverage too.

euclodius avatar Jul 06 '26 10:07 euclodius