Skip to content

[Bug] Agent is marked as "Done" when the CLI is not installed #7047

Description

@orca-discord-issues

Gabriel Gabriel via Discord

Hey guys! 👋

While setting up a fresh machine as an Orca server, I found what looks like a small bug.

I started a Claude Code / Codex agent on a server where neither CLI was installed yet.

Instead of detecting that the CLI executable is missing, Orca still creates an agent entry in the sidebar and marks it as "Done", even though the process never actually started.

Steps to reproduce
Set up a fresh Orca server.
Do not install codex (or claude).
Start a Codex or Claude agent.
Open the terminal.
Expected behavior

Orca should detect that the required CLI is not installed and:

show a clear error (e.g. "codex command not found"),
mark the agent as Failed (or avoid creating it altogether),
not display it as a completed agent.
Actual behavior

The terminal correctly shows:

zsh: command not found: codex

However, Orca still creates an agent in the sidebar and shows it as Done, which is misleading because the agent never actually ran.
image.pngimage.png

Activity

  1. orca-discord-issues commented on Jul 1, 2026

    @orca-discord-issues
    Author

    Gabriel Gabriel via Discord

    this is not important at all , just a small detail

  2. added theissue type on Jul 12, 2026
  3. nwparker commented on Jul 18, 2026

    @nwparker
    Contributor

    Reproduced (unit test, headless-server agent-status derivation).

    Root cause: OrcaRuntimeService.buildPtyMobileAgentStatus (src/main/runtime/orca-runtime.ts:22530) — the derivation that produces the agentStatus every paired web/mobile client renders — sets state via lastAgentStatus === 'working' ? 'working' : === 'permission' ? 'blocked' : 'done'. Anything that isn't actively working/permission collapses to done, including an agent whose CLI was never installed. The PTY record already carries lastExitCode (127 = command not found, orca-runtime.ts:1027) but the derivation never reads it, and nothing ever produces a failed state (failed exists only as a UI label in worktree-card-agent-summary.ts:44). The renderer-synced branch (orca-runtime.ts:22368-22383) resets launched agents to state: 'done' the same way.

    Evidence: a unit test calls the real derivation with a launched-but-missing Codex PTY record (launchAgent: 'codex', lastExitCode: 127, lastAgentStatus: 'idle') → client is told state: 'done'. A second case shows exit 127 and exit 0 both derive done, proving it's exit-code-blind.

    Re-run:

    pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/repro-7047-cli-missing-marked-done.test.ts
    

    Fix direction: consult the PTY exit signal — a non-zero exit (esp. 127) with no real working/hook state should derive a failed state or suppress the row, rather than defaulting to done; mirror it in the renderer derivation so desktop and server agree.

    Key files: src/main/runtime/orca-runtime.ts, src/renderer/src/components/sidebar/worktree-card-agent-summary.ts, repro at src/main/runtime/repro-7047-cli-missing-marked-done.test.ts.


    Automated bug-reproduction pass. Repro artifact committed on branch nwparker/bug-repro-pass2; check it out to run the command above. Writeup: docs/bug-reproductions/7047.md.

  4. added
    has_reproConclusive reproduction exists (test/script/CLI evidence). See docs/bug-reproductions/
    on Jul 18, 2026
  5. added a commit that references this issue on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghas_reproConclusive reproduction exists (test/script/CLI evidence). See docs/bug-reproductions/

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions