feat(codex): start a codex session at a chosen reasoning effort - #515
Open
irisitymichaelgrundberg wants to merge 2 commits into
Open
irisitymichaelgrundberg wants to merge 2 commits into
irisitymichaelgrundberg wants to merge 2 commits into
Conversation
codexConfig takes a `reasoningEffort`, one of the levels codex accepts, and the session starts with `--config model_reasoning_effort=<level>`. The registry declares one literal per level, gated on the enum, because an argv token cannot splice a value into a literal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ser clamp Both create schemas now refuse an unknown level, and a non-granted owner's codexConfig keeps its reasoningEffort when the clamp forces bypass off. docs/architecture-invariants.md lists the two --config values codex now takes from codexConfig. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
irisitymichaelgrundberg
marked this pull request as ready for review
October 2, 2026 04:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #513 (the Codex half).
codexConfigtakes a newreasoningEffort, and a codex session starts with--config model_reasoning_effort=<level>.Why
A caller can pick codex's model per session through
codexConfig.model, but not its reasoning effort, so every session starts at whatever~/.codex/config.tomlsays. Claude sessions already take an effort per session througheffort.What it does
CODEX_REASONING_EFFORTSinsrc/types/session.tslists the levels codex accepts as of codex-cli 0.154.0:none,minimal,low,medium,high,xhigh,maxandultra. Which of them a given model honours is codex's call.CodexConfiggets a matchingreasoningEffortfield.CodexConfigSchemavalidatesreasoningEffortas an enum built from that list, so bothPOST /api/sessionsandPOST /api/quick-startreject anything else.model_reasoning_effort=<level>as one--configvalue. The Codex entry therefore declares areasoningEffortenum parameter and one--config model_reasoning_effort=<level>argument per level, each gated on its own value. A level the enum doesn't know emits nothing. The registry needed no new argument shape for this.--modeland before theresume <id>subcommand, so a resumed session keeps its effort too.The "Codex specifics" list in
docs/architecture-invariants.mdnow names the two--configvalues codex takes fromcodexConfig.codexConfigalready round-trips throughSessionState, so the effort survives a respawn and a Codeman restart.npm run generate:cli-catalog -- --checkreports the catalogue in sync, because launch arguments aren't part of it.Testing
npm testpasses, as do typecheck, lint, format and the catalogue check.test/cli-registry-spawn-golden.test.tsgains two cases:codex --model gpt-5 --config model_reasoning_effort=high resume roll_42.test/codex-reasoning-effort-schema.test.tschecks that both create schemas accept every level, and that both reject unknown words and shell characters.test/routes/external-cli-bypass-clamp.test.tschecks that a non-granted owner in multi-user mode keeps the effort when the clamp forces bypass off.codex --config model_reasoning_effort=xhighstarts codex-cli 0.154.0 withgpt-5.6-sol xhighin its header, where the user config saysmedium. Codex needs no extra quoting around the level.No changeset, following the repository's convention for contributors.
🤖 Generated with Claude Code