agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

New task shows raw "binary not found on PATH" error instead of an install prompt when Codex CLI isn't installed

Open somewherelostt opened this issue 1 month ago • 3 comments

Summary

On Windows, when Codex is selected in the New task composer and the Codex CLI isn't installed, AO shows a raw internal error and the model picker stays stuck on Select model:

codex model discovery: chat driver unavailable: codex: agent: binary not found on PATH

The real cause was simple: the Codex CLI wasn't installed. Only the Codex desktop app was. After running npm i -g @openai/codex and restarting AO, Codex models loaded normally.

The problem is the UX. The error is a chain of Go wrapped errors (codex model discovery: chat driver unavailable: codex: agent: …). It doesn't tell the user that the Codex CLI is missing or how to install it, and a user who already has the Codex desktop app reasonably thinks Codex is installed.

Steps to reproduce

  1. On Windows, have no standalone Codex CLI installed (where codex finds nothing). Having only the Codex desktop app is enough.
  2. Open AO, click New task on a project, and select Codex.
  3. The composer shows the raw error above, and Select model is empty.

Expected behavior

The composer shows a friendly, actionable state instead of the raw error, for example:

Codex CLI isn't installed. AO needs the Codex command-line tool to run Codex tasks. [Install Codex] · [How to install]

Ideally:

  • Install Codex runs AO's managed Codex install, or shows npm i -g @openai/codex.
  • After installing, AO detects the CLI without a full app restart, or prompts for one.
  • The raw error text stays available behind a "Details" toggle for debugging.

Actual behavior

The raw wrapped error string is shown in orange above the composer, with no next step.

AO version

0.14.5-nightly.202610220502 (desktop app, bundled daemon)

Environment

  • Windows 11 Home (10.0.26200) x64
  • Codex desktop (MSIX OpenAI.Codex) 26.1016.6573.0 installed; no standalone Codex CLI at the time

Notes

  • The error is a ports.ErrAgentBinaryNotFound from ResolveCodexBinary (backend/internal/adapters/agent/codex/codex.go). The model catalog wraps it as codex model discovery: … (backend/internal/adapters/agent/modelcatalog/catalog.go), and the composer shows the string unchanged. Mapping ErrAgentBinaryNotFound to a typed "not installed" catalog warning, the way auth problems are already mapped to sign-in states, would let the UI render a proper install prompt for every agent, not just Codex.
  • Optional follow-up: Codex desktop ships its own CLI at %LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe, which AO doesn't check. Using it as a last-resort fallback would make a desktop-only install just work, but a clear install prompt is the main fix.
  • Related: #5003 (AO's CLI lags behind Codex desktop), #2582 / #2583 (WindowsApps Codex aliases are skipped).

somewherelostt avatar Oct 22 '26 14:10 somewherelostt

Update: confirmed the root cause was simply that the Codex CLI wasn't installed (only the Codex desktop app was). Installing it fixed the problem:

npm i -g @openai/codex
codex login

After fully restarting AO, Codex models loaded in New task as expected.

Could we handle this on the UI side? Instead of the raw codex model discovery: chat driver unavailable: codex: agent: binary not found on PATH error, the composer could show a clear "Codex CLI isn't installed" message with an Install action. I've updated the description with the details.

somewherelostt avatar Oct 22 '26 14:10 somewherelostt

I am working on a minimal fix: a typed missing-CLI model-catalog warning and an actionable New task install state, with regression tests and desktop verification.

Vaibhaav-Tiwari avatar Oct 25 '26 13:10 Vaibhaav-Tiwari

Closing: this no longer reproduces on main.

I retested on 2026-11-19 (Windows, AO built from main) on an isolated daemon with a fresh data dir. Codex was hidden from both PATH and npm's global folder, because AO also finds it in %APPDATA%\npm.

  • ao agent ls reports Codex as needs install, and New Task's agent picker no longer offers it, since it lists only agents that can start locally.
  • GET /api/v1/agents/codex/models returns an empty list with no error. The raw codex model discovery: … binary not found on PATH chain from the report is gone.
  • Starting a Codex task anyway returns AGENT_BINARY_NOT_FOUND, and New Task turns that into "This agent is not installed. Open Agent Harnesses settings to install it, then try again." with an install action.

#7207 looks like it's no longer needed for this. If you still see a raw discovery error with Codex missing, please reopen with the AO version and the exact message.

nikhilachale avatar Nov 19 '26 11:11 nikhilachale