Skip to content

Add fable alias and per-run effort; fix Codex 0.167+ account usage - #72

Merged
upsetbit merged 8 commits into
c3-oss:masterfrom
cordeirogustavo:fix/claude-aliases-effort-account-usage
Dec 4, 2026
Merged

upsetbit merged 8 commits into
c3-oss:masterfrom
cordeirogustavo:fix/claude-aliases-effort-account-usage

Conversation

@cordeirogustavo

Copy link
Copy Markdown
Contributor

Summary

Codex CLI 0.167+ (verified on 0.173.0) only accepts on-request and never for approvals, which broke the Codex account-usage reader (-a untrusted) and makes runs with the untrusted approval policy exit before the first event. Claude Code also gained a fable model alias and an --effort flag, and Codex exposes per-model reasoning levels through model_reasoning_effort; the library had no first-class way to set either.

Changes

  • Claude aliases (all five): add fable next to haiku/sonnet/opus (ClaudeModelFable, claude_model::FABLE, ClaudeModel.Fable, CLAUDE_MODEL_FABLE, ClaudeModels.Fable); docs and tests updated.
  • Reasoning effort (all five): new Effort/effort request field. Codex: -c model_reasoning_effort="<level>" (new runs and resume, TOML-escaped). Claude: --effort <level>. Grok: rejected as invalid request, like other options Grok has no equivalent for. Free string, like Model, because accepted levels vary per agent and per model (Codex 0.173 models accept low..xhigh, ..max, or ..ultra; Claude documents low..max) and both CLIs check the value themselves.
  • Account usage (Go, Rust core → Node/Python, .NET): start codex -s read-only -a never app-server --stdio instead of -a untrusted, which 0.167+ rejects with invalid value 'untrusted' for '--ask-for-approval'.
  • Untrusted approval (all five): deprecated rather than removed or remapped (Go Deprecated:, Rust #[deprecated], .NET [Obsolete], Node/Python type docs). Still passed through so older Codex releases keep working; Grok still maps it to default. Docs and example CLI help updated.
  • Docs: docs/examples/*.md gain a "Reasoning effort" section and the deprecation note.

Test plan

  • just ci passes locally — run recipe by recipe without just: Go vet/golangci-lint/gosec/govulncheck/tidy/test -race/build, Rust fmt/clippy/test, Node build+test, Python build+pytest, .NET build/format/test, markdownlint, lychee, gitleaks all pass; rust-audit, dotnet-verify-pack, and the net8.0 test lane were not run locally.
  • New behavior covered by tests (alias values, effort argument building/escaping/resume/Claude flag/Grok rejection, app-server arguments, untrusted pass-through)
  • Docs updated
  • Checked against the real codex-cli 0.173.0 without a login: account usage now gets past app-server startup to the auth step; exec --json events (thread/turn started, error, error item, turn.failed) decode without errors.

Related

  • Codex 0.167+ approval policy change (-a/approval_policy now on-request | never).

cordeirogustavo and others added 8 commits December 3, 2026 17:28
Claude Code's --model flag now documents 'fable' alongside 'opus' and
'sonnet' as an alias for the latest model of that family. Expose it
next to the existing haiku/sonnet/opus constants in Go, Rust, Node,
Python and .NET, and list it wherever the docs enumerate the aliases.
Add Effort/effort to the run request in Go, Rust, Node, Python and
.NET. Codex receives it as -c model_reasoning_effort="<level>" on new
runs and on resume, Claude Code as --effort <level>, and the grok agent
rejects it with an invalid-request error, like every other option Grok
has no equivalent for.

The value is a free string instead of a validated set, the same way
model is treated. The accepted levels differ per agent and per model:
the Codex 0.173 bundled catalog lists low through xhigh for some
models, through max for others, and also ultra for most, while Claude
Code documents low, medium, high, xhigh and max. Neither CLI rejects an
unknown level up front (Claude warns and falls back to its default,
Codex loads the config and starts the turn), so a fixed list in the
library would only reject valid levels as soon as either CLI adds one.
The Codex value is written as a quoted TOML string with backslashes and
quotes escaped, so it is never reparsed as another TOML type.
Codex 0.167 and newer only accept on-request and never for
--ask-for-approval, so the account usage readers in Go, Rust (and the
Node and Python bindings built on it) and .NET failed before the app
server started. Against codex-cli 0.173.0 the call returned:

  initialize codex app-server: codex app-server closed stdout:
  error: invalid value 'untrusted' for '--ask-for-approval
  <APPROVAL_POLICY>' [possible values: on-request, never]

Start it with -s read-only -a never instead. The reader only issues
JSON-RPC reads and never runs a turn, so read-only plus never keeps
the intent of a sandboxed, non-interactive process; on-request would
let the server ask for approvals nobody answers. --stdio is still
accepted on 0.173.
Codex runs pass the approval policy as -c approval_policy="<value>".
Codex 0.167 and newer, including 0.173.0, refuse the untrusted value
while loading the config and exit with code 1 before any event:

  Error: approval_policy = "untrusted" is no longer supported; remove
  this setting

The CLI now only accepts on-request and never (-a/--ask-for-approval
lists exactly those two). There is no equivalent to map untrusted to:
on-request lets the model decide when to ask, which is a different
policy, and rewriting it silently would change behavior. Removing the
value would break builds and older Codex installs that still accept
it.

Mark it deprecated instead, in each language's idiom: a Deprecated:
paragraph in Go, #[deprecated] in Rust (allowed where the crate and the
Node and Python bindings still map it), [Obsolete] in .NET, and the
type documentation in Node and Python. The value is still passed
through unchanged, so older Codex releases keep working and newer ones
keep reporting their own error in the exit error's stderr; Grok runs
still map it to Grok's default permission mode. The example CLI help,
the docs, and the resume tests now use on-request; new Go, Rust and
.NET tests pin the pass-through (Node and Python reuse the Rust core).
@upsetbit
upsetbit merged commit 24d13f3 into c3-oss:master Dec 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants