Fix Codex profile reasoning_effort and verbosity defaults#140
Merged
Conversation
The Codex CLI defaults both `model_reasoning_effort` and `model_verbosity` to "low", but `gpt-5.2-codex` (the default Codex model) only accepts "medium" for both. Out-of-the-box `codex exec` against the AI Gateway fails with: Unsupported value: 'low' is not supported with the 'gpt-5.2-codex' model. Supported values are: 'medium'. The error covers both the `reasoning.effort` and `text.verbosity` request parameters, depending on which the model rejects first. Set both fields to "medium" in two places: - the generated profile config in ~/.codex/default.config.toml - explicit -c flags on `codex exec`, since CLI flags have the highest precedence and we observed the profile-only setting being silently overridden by the CLI's "low" default in some Codex versions. `generateCodexConfig` now accepts an optional `reasoningEffort` parameter so callers can override per-run via `model: "gpt-5.2-codex?reasoningEffort=high"`. Verified end-to-end against the Vercel AI Gateway: a previously-failing `codex exec` smoke run now completes in ~31s and returns a real response instead of erroring at `turn.failed`. Also added `vercel-agent-eval-*.tgz` to .gitignore so local `npm pack` artifacts don't leak into commits.
Per review feedback. Local `npm pack` artifacts can be cleaned up by hand; no need for a project-level ignore rule.
molebox
approved these changes
May 28, 2026
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.
Summary
The Codex CLI defaults both
model_reasoning_effortandmodel_verbosityto
"low", butgpt-5.2-codex(the default Codex model) only accepts"medium"for both. Out-of-the-boxcodex execagainst the AI Gatewayfails with:
The error covers both the
reasoning.effortandtext.verbosityrequestparameters, depending on which the model rejects first.
This PR sets both fields to
"medium"in two places:~/.codex/default.config.toml—ensures the value is captured for any tool that inspects the config.
-cflags oncodex exec— CLI flags have the highestprecedence and we observed the profile-only setting being silently
overridden by the CLI's
"low"default in some Codex versions.generateCodexConfignow accepts an optionalreasoningEffortargumentso callers can still override per-run via
model: "gpt-5.2-codex?reasoningEffort=high".Test plan
"medium"defaults and explicit-override pathsfor both AI Gateway and direct OpenAI configs (6 cases in
src/lib/agents/codex.test.ts).npm test— 184 passed | 14 skipped.npm run lintclean.the patched build into
a0-localand running a one-prompt Codex smoke. Without the fix,
turn.failedwith the
Unsupported value: 'low'error within ~10s. With the fix,a real response is produced in ~31s.
Notes
vercel-agent-eval-*.tgzto.gitignoreso localnpm packartifacts don't leak into commits.
#138 / #139 Codex profile-config fix
— that PR fixed the legacy
profile = "default"rejection; this onefixes the next layer (reasoning effort + verbosity defaults) so Codex
actually completes a turn.