feat(agents): offer Codex's max and ultra reasoning efforts

Merged
SA
2mo ago
+172-15

The Codex effort picker in the new-workspace modal stopped at xhigh, so the two levels above it were unreachable even though codex-cli has accepted them for several releases.

They are not available on every model, which is why they arrive with a restriction rather than as two more flat entries. Codex's own model catalog (supported_reasoning_levels in models_cache.json) says:

modeltop level
gpt-5.6-sol, gpt-5.6-terraultra
gpt-5.6-lunamax
gpt-5.5, gpt-5.4xhigh

The CLI does not police the pairing — -c model_reasoning_effort=ultra with --model gpt-5.5 launches happily and dies on the first turn, which in a workspace means an agent that looks started and never answers.

So an effort option can now name the models that accept it, and the offered set follows the model picker. Absent models means every model takes it, which is every other entry in the catalog. An unset model keeps the full list — the launch omits --model and runs whatever default the CLI resolves — and so does an id outside the curated catalog, which buildAgentModelArgs already drops for the same reason.

A remembered effort the current model rejects stays in localStorage but reads as "Default effort" and launches as one, so switching from Sol to GPT-5.5 downgrades visibly instead of sending ultra along. The host validates the pair too, so superset agents create --effort ultra --model gpt-5.5 gets the supported list back rather than a broken session.

Both new-workspace surfaces (the compact prompt group and the full screen) read the same list.

Verification

biome, typecheck (shared, host-service, desktop), and the full suites for every touched package: shared 907 pass, host-service 1440 pass, desktop 3238 pass. Per-model gating and the launch-arg drop are covered by new tests in agent-models.test.ts and agents.test.ts; the host-service case that pinned "max" as an invalid Codex effort now uses "extreme".

https://claude.ai/code/session_01JQ34D61zccarfUjbmdh477


Summary by cubic

Adds Codex's max and ultra reasoning efforts to the new-workspace modal, gated per model so unsupported combinations can't launch a broken agent.

  • Effort options can now declare which models accept them; the offered set follows the model picker.
  • Host validation and launch-arg building both reject an effort the selected model does not accept.
  • A remembered effort the current model rejects is read as "Default effort" and launches as the default.

Summary by CodeRabbit

  • New Features

    • Effort options now adapt to the selected agent and model.
    • Added support for additional model-specific effort levels, including max and ultra where available.
    • Unsupported effort selections automatically fall back to the agent’s default.
  • Bug Fixes

    • Prevented unsupported effort values from being submitted during workspace launches.
    • Improved validation messages to identify model-specific limitations.