orca icon indicating copy to clipboard operation
orca copied to clipboard

[windows] Sometimes Grok CLI is not detected in Orca but works in system terminal

Open AmethystLiang opened this issue 4 months ago • 1 comments

Issue Description

When using the Grok CLI through Orca, it doesn't work properly. However, the same CLI works fine when using the system's built-in terminal.

Restarting the computer fixes it

Steps to Reproduce

  1. Open Orca terminal
  2. Try to use CLI commands
  3. Commands fail or don't respond as expected

Expected Behavior

Grok CLI should work in Orca terminal just like it does in the system terminal.

Actual Behavior

Grok CLI fails to work in Orca terminal.

Environment

  • Platform: windows WSL
  • Orca Version: Latest
  • Grok CLI: System installed

Workaround

Restarting the computer temporarily resolves the issue.

Additional Context

The issue appears to be specific to how Orca's terminal environment handles certain CLI tools. The system terminal works fine with the same tools.

Image

Made with Orca 🐋

AmethystLiang avatar Jul 12 '26 05:07 AmethystLiang

Agent reproduction package (Windows orchestration 2026-07-16)

Host context: Windows 11 / Orca 1.4.143.0 / repo path used: docs/bug-reproductions/
Labels applied: see issue labels (has_repro or cannot_repro).
Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.


Issue 8366 — Sometimes Grok CLI is not detected in Orca but works in system terminal

Status: repro_confirmed
Host: Windows 11 10.0.26200, Orca 1.4.143.0
Label: has_repro
Issue: https://github.com/stablyai/orca/issues/8366

Summary

Two related failures reproduced on installed Orca 1.4.143:

  1. PATH gap: User PATH includes C:\Users\neil\.grok\bin, but Orca-managed PowerShell terminals do not. Bare grok fails with CommandNotFoundException while the same binary works in a system terminal.
  2. Detection/status lag: Launching via absolute path starts the Grok TUI and hooks, but orca worktree ps often still omits agentType: grok (stale Codex row only). Accessibility eventually shows “Grok idle” while the terminal title/preview show active Responding….

Environment

Item Value
Grok CLI grok 0.2.101 at C:\Users\neil\.grok\bin\grok.exe
User Path contains C:\Users\neil\.grok\bin
Orca terminal PATH (probe) pnpm, Herdr, OpenAI Codex, npm — no .grok\bin
Hooks grok hooks installed (~\.grok\hooks\orca-status.json)

Repro

$env:PATH = "C:\Users\neil\AppData\Local\Programs\orca\resources\bin;" + $env:PATH

# A) Bare launch fails inside Orca PATH
orca terminal create --worktree path:C:/Users/neil/orca/orca --command "grok" --json
# terminal preview: CommandNotFoundException for grok

# B) System shell works
& "C:\Users\neil\.grok\bin\grok.exe" --version

# C) Full path starts TUI; detection still weak
orca terminal create --worktree path:C:/Users/neil/orca/orca --command "C:\Users\neil\.grok\bin\grok.exe" --json
Start-Sleep 15
orca worktree ps --json   # main worktree: often only codex:done, no grok row
orca terminal list --json # title may be "… - grok" / "Responding…"

PATH probe inside Orca terminal:

$env:PATH -split ';' | Where-Object { $_ -match 'grok|npm|codex' }
Get-Command grok,codex,claude -ErrorAction SilentlyContinue
# codex + claude resolve; grok does not

Evidence

File What it shows
evidence/8366-grok-terminal-create.json create OK
evidence/8366-orca-terminal-path-probe.json PATH missing .grok\bin; Get-Command grok empty
evidence/8366-system-path-comparison.json User Path has .grok\bin
evidence/8366-grok-fullpath-create.json absolute path launch OK
evidence/8366-main-agents-after-prompt.json only codex:done after Grok running
evidence/8366-main-terminals-titles.json title Responding… - grok / active preview
evidence/8366-grok-processes.txt live grok.exe + grok-hook.cmd
evidence/8813-a11y-agent-status-lines.txt UI: Grok idle; Codex done while Grok responding
issues/8366.json cached issue

Expected vs actual

Expected grok on PATH in Orca terminals; detected as Grok with live status
Actual Missing from PATH; bare launch fails; full-path TUI runs but sidebar/worktree ps lag or show idle

Source linkage

  • TUI_AGENT_CONFIG.grok — detectCmd/expectedProcess = grok (src/shared/tui-agent-config.ts)
  • Repo contains newer windows-registry-path / PATH refresh work (seen in live Claude output on repo worktree) that may address (1) but is not fully reflected in behavior of packaged 1.4.143 terminals for .grok\bin.

Conclusion

has_repro — Grok works outside Orca; Orca terminal environment omits Grok’s bin dir; detection/status remain unreliable after absolute-path launch.


How another agent should use this

  1. Read this comment fully (status, expected vs actual, blockers).
  2. If a script is included above, copy it to a temp file and run it on a Windows 11 host with Orca installed (prefer production install under %LOCALAPPDATA%\Programs\orca).
  3. Capture evidence (CLI --json, screenshots, logs) under a local folder; optionally comment results back here.
  4. If status is cannot_repro / needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: remove cannot_repro, add has_repro when conclusive.

OrcaWin avatar Jul 17 '26 00:07 OrcaWin