block / block/buzz

[Bug] Windows: Codex model discovery times out / empty models (cold start >10s)

Open
#2,261 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Summary

On Windows, Codex model discovery via `buzz-acp models` (spawn adapter → ACP `initialize` → `session/new`) often takes **~15–25s** cold. Shipped `MODELS_TIMEOUT` is **10s**, so discovery fails or returns empty models even though the adapter eventually succeeds.

This breaks / degrades onboarding and agent config model pickers for Codex after a successful install.

## Environment

- OS: Windows 11
- Runtime: `@agentclientprotocol/codex-acp` (Node shim under nvm, e.g. `~\.nvm\versions\node\...\bin\codex-acp.cmd`)
- Observed: full probe ~**20s** with absolute path under a longer timeout; **times out at 10s** with product timeout

## Reproduction

1. Install Codex / `codex-acp` so discovery finds the runtime.
2. Open first-run onboarding (or agent defaults / model picker that calls `discover_agent_models` / `buzz-acp models`).
3. Observe empty models, silent failure, or timeout-shaped errors while Codex is still cold-starting.

Direct probe (illustrative):

```text
buzz-acp models --json --agent
# cold: often ~20s on Windows; product budget is 10s
```

## Expected

- Discovery waits long enough for a cold Codex ACP boot, **or**
- UI shows clear **loading** for a slow probe, then a **clear timeout error** with an easy **Retry**
- Prefer caching models after first success so every UI open is not a full cold spawn

## Actual

- 10s timeout kills the probe mid-boot
- Models list empty / no useful error in some onboarding paths
- Re-probe always cold-starts Node + Codex App Server (no warm cache)

## Root cause (split)

| Layer | Responsibility |
|--------|----------------|
| **Upstream** `@agentclientprotocol/codex-acp` + Codex App Server | Real cold-start cost (stdio adapter boots Codex app server) |
| **Buzz** `MODELS_TIMEOUT` (10s) + desktop discovery UX | Timeout too short for Windows cold start; weak loading/error/retry |

Git Bash is **not** on the models spawn path (`Command::new` / absolute `.cmd` → node). Related but separate: Windows install/PATH ([#2238](https://github.com/block/buzz/issues/2238)).

## Suggested Buzz fixes

1. Raise `MODELS_TIMEOUT` (e.g. 30–45s) or make it adaptive for slower adapters
2. UI: longer loading copy for Codex, clear timeout message, one-click Retry
3. Cache successful model catalogs by runtime command + version
4. Ensure Windows resolves `codex-acp.cmd` / nvm bin on child PATH (bare name often “program not found” when nvm4w ≠ `.nvm`)

## Related
- #2246 — Surface model discovery failures in agent config UI (partial UX)
- Upstream adapter: https://github.com/agentclientprotocol/codex-acp (starts Codex App Server per process)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.