feat(codex): support max reasoning effort - #1683
Open
sean2077 wants to merge 2 commits into
Open
Conversation
chenhg5
reviewed
Aug 15, 2026
chenhg5
left a comment
Owner
There was a problem hiding this comment.
Conclusion: Comment (PR is in DRAFT — convert to ready-for-review when blockers resolved)
Overall assessment:
- This PR is a small, well-scoped change that adds
maxas a recognized Codex reasoning effort and updates the localized/reasoningusage string. The change is correct and minimal, but the PR is currently marked as a draft and the author flags thatgo build ./...is still blocked on pre-existing upstream-main issues. Two small items below should be addressed before flipping to "ready for review".
Review scope:
- agent/codex/codex.go — added
case "max", "maximum": return "max"innormalizeReasoningEffort; added"max"toAvailableReasoningEfforts(). - agent/codex/session_test.go — added
TestNormalizeReasoningEffort_AcceptsMaxand updatedTestAvailableReasoningEfforts_ExcludesMinimal. - core/i18n.go — appended
|maxto all five locales inMsgReasoningUsage. - Run:
go test -race ./agent/codex/... -count=1 -timeout 60s→ ok in ~2.7s.go test -race ./core/... -run 'TestReasoning|TestCUJ' -count=1 -timeout 60s→ ok in ~3.9s.
✅ What looks good:
- Aliases both
"max"and"maximum"in the normalizer — matches the previous convention (xhigh/x-high/very-high). - Updated all 5 locales in one go; no half-translated usage string.
- Test naming follows the existing convention (
TestNormalizeReasoningEffort_*,TestAvailableReasoningEfforts_*). - Behavioral change is isolated to the Codex agent's
normalizeReasoningEffortandAvailableReasoningEfforts; no core contract changes.
🚨/🔴 Must fix:
- None. No correctness/security/blast-radius issue found.
🟠 Should improve:
- 🟠 P2 — PR is in Draft state. The body explicitly notes that
go build ./...is blocked on pre-existing upstream-main issues (daemon.CheckLingerduplicates, unusedosimport inagent/pi/proc_windows.go). Those are not in this PR's diff, so it is fine to merge the code change, but please either (a) confirm on the PR thread that the failures reproduce onorigin/mainHEAD without this branch, or (b) attach ago build ./agent/codex ./corelog so reviewers can see the change itself builds cleanly. - 🟠 P2 —
MsgReasoningUsageis shared across agents. Adding|maxis correct for Codex, but if Codex is the only agent exposingmax, the/reasoningusage string on non-Codex projects will now advertise a value that is rejected (reasoning_effort=maxfalls back to default for Claude/Copilot/etc). Consider either moving the usage string to be per-agent, or wording it as "your agent's available values" so non-Codex users don't see misleading options. - 🟠 P2 —
AvailableReasoningEffortshardcodes the list. Now that we have a precedent for adding reasoning levels, future additions will all touch this list. Consider a single source of truth (e.g. a package-level slice with both the level name and any aliases), so the test does not need to be edited on every change. - 🔵 P3 — CHANGELOG.md is untouched. Suggest adding
### Added — codex: support 'max' reasoning effort via /reasoning max (#1683)to Unreleased. - 🔵 P3 — Single-commit PR with 18 additions. Squash before merge is unnecessary, but the commit subject could mention the i18n impact: e.g.
feat(codex): support max reasoning effort (incl. /reasoning usage string).
❓ Questions:
- The PR description claims
npm run buildinweb/was run. There are no web/ changes in the diff; was this a sanity check, or did the build pick up the i18n change? Worth confirming whether the web bundle embeds the usage string. - For projects where Codex is the agent and the model chosen does NOT support
maxeffort (e.g. legacycodex-mini-latest), will/reasoning maxsend an invalid value to the model and trigger a runtime error, or is there a per-model allowlist in the Codex agent that filters unsupported levels? If the former, this PR could regress those users.
Testing / Risk:
- Verified: codex tests + core reasoning/CUJ tests pass with
-race. go build -tags no_web ./...clean.- Risk surface: minimal. The only behavioral change is
normalizeReasoningEffort("max")returning"max"instead of"", andAvailableReasoningEffortsnow contains"max". Both are additive. - Not covered: end-to-end test that
/reasoning maxactually toggles the Codex agent's reasoning setting (would require a Codex CLI fixture). Acceptable to defer.
Next step:
- Convert to ready-for-review once the P2 items are addressed (especially confirming the
go build ./...failure is pre-existing onmain, not introduced by this branch). The change itself is sound and would be straightforward to approve as-is.
Contributor
Author
|
Addressed the review feedback in 698aec0.
Answers to the two questions:
Focused tests, CUJ, vet, and targeted build are green locally. The updated CI run is in progress. |
sean2077
marked this pull request as ready for review
August 15, 2026 14:59
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
maxandmaximumas Codex reasoning-effort valuesmaxthrough the/reasoningselector/reasoningusage from each agent'sAvailableReasoningEfforts()instead of a shared hardcoded listWhy
Codex models such as GPT-5.6 support a
maxreasoning effort. cc-connect previously normalized that value to an empty string, soreasoning_effort = "max"silently fell back to the Codex default and/reasoning maxwas rejected.The previous shared usage string was also inaccurate across agents: Pi exposes
offandminimal, while Claude Code and Codex expose different level sets. Usage text now follows the current agent capability list.User impact
Codex projects can configure
reasoning_effort = "max", and users can select it through/reasoning max. Existing reasoning levels and session-reset behavior are unchanged. Other agents now show only the reasoning levels they actually advertise.Validation
Passed locally on Windows:
go test ./agent/codex -count=1go test ./core -run 'TestCmdReasoning|TestReasoning' -count=1go test ./core/ -run TestCUJ -count=1go vet ./agent/codex ./corego build ./agent/codex ./corego build ./...still reproduces the pre-existing Windows baseline failures outside this PR: duplicatedaemon.CheckLingerdefinitions and an unusedosimport inagent/pi/proc_windows.go. The full test suite also contains pre-existing Windows-only failures that assume Unix executables, paths, symlink behavior, or file modes. Race tests could not be rerun locally because this Windows Go environment has CGO disabled; the previous CI run and maintainer review race runs passed.Compatibility notes
npm run buildwas only a repository sanity check. The localized/reasoningstrings are rendered by the Go backend and are not embedded in the web bundle, so it is omitted from the focused validation above.xhigh, the selected value is passed to Codex CLI/provider for validation.maxis sent only when a user explicitly configures or selects it; unsupported model/provider combinations may reject it at runtime.