feat(codex): extend GPT-5.6 reasoning and fallback support - #1657
Open
AaronZ345 wants to merge 4 commits into
Open
feat(codex): extend GPT-5.6 reasoning and fallback support#1657AaronZ345 wants to merge 4 commits into
AaronZ345 wants to merge 4 commits into
Conversation
chenhg5
approved these changes
Aug 13, 2026
chenhg5
left a comment
Owner
There was a problem hiding this comment.
结论: Approve
总体判断: 一个 Codex feature 扩展——把 reasoning effort 从 4 个 level(low/medium/high/xhigh)扩到 8 个(none/minimal/low/medium/high/xhigh/max/ultra),与 Codex CLI 0.144+ 对齐。同时更新 GPT-5.x fallback 模型列表(仅在 catalog / cache / API discovery 全部失败时使用)。修复了「Codex 0.144+ 用户切 reasoning 但 cc-connect 显示 stale four-level usage」的体验问题。建议合入。
Review 范围:
- 看了
agent/codex/codex.go中normalizeReasoningEffort(加 none/minimal/max/ultra + alias)+AvailableReasoningEfforts返回 8 项 +defaultCodexModels加 GPT-5.x fallback。 - 看了
core/engine.go中新增reasoningUsage(efforts []string)helper + 两个 call site 替换。 - 看了
core/i18n.go中 5 个语言版本的MsgReasoningUsage改为%s占位符。 - CI: 2 次 run 都全绿(首次 push + rebase 后)。
✅ 做得好的地方:
- 与 upstream Codex 0.144+ 对齐:作者明确指出
cc-connect previously normalized values beyond xhigh to an empty string,这条 fix 让 cc-connect 不再「无理由拒绝」Codex CLI 已经支持的值。这是「adopt upstream capability」的最小改动。 normalizeReasoningEffort加 alias:off/disabled/disable都映射到none,min→minimal,extra-high/extra_high/very-high→xhigh,maximum→max。这种 alias 容错让 user 输入有弹性。reasoningUsagehelper 抽出来避免重复:/reasoningchat command +renderReasoningCard共用同一个 helper,避免「改了 chat command 但忘了 card 渲染」的 drift。- i18n 完整同步:5 个语言版本(English / 简体中文 / 繁體中文 / 日本語 / Español)都更新成
%s占位符——这与既有MsgModeUsage模式一致("%s" 占位 + runtime fill)。 defaultCodexModels的 fallback 策略:只在AvailableModels三个 source(catalog / cache / API discovery)都失败时使用 hardcoded fallback——这条优先级与 PR body 描述一致。
🟠 建议改进(不阻塞):
- GPT-5.6 sol/terra/luna 模型名核实:这些名字 (
gpt-5.6-sol/gpt-5.6-terra/gpt-5.6-luna/gpt-5.6) 看起来像内部 / codename,不是 Codex CLI 已发布的官方模型名。如果 fallback 在 catalog 全部失败时被显示,会误导用户。建议作者在 PR body 或 commit message 注释这些名字的来源(上游 Codex 0.144+ 已确认 / 推测未来模型 / 内部代号),便于 reviewer 判断可信度。 defaultCodexModels应该附LastVerified时间戳:hardcoded fallback 容易 stale。建议加一行注释# Last verified: YYYY-MM-DD against Codex CLI X.Y.Z让 future maintainer 知道何时该刷新。reasoningUsage输出格式:当前直接strings.Join(efforts, "|")— 如果 efforts 是 8 个,输出会很长。考虑 truncated 展示(none|minimal|low|medium|high|xhigh|max|ultra共 44 字符)。i18n 字符串 "%s" 直接拼,建议加一个隐式分隔或者 prefixlow|medium|...(已有顺序)已合理。
🔵 可选优化:
- 无。
Testing / Risk:
- 已看到的验证: CI 2 次 run 全绿;
go test -tags no_web ./cmd/cc-connect ./core ./agent/codex -count=1通过;git diff --check通过。 - 未覆盖风险: real Codex CLI 0.144+ 用 none/minimal/max/ultra 切 reasoning 的真实场景——但这是 upstream 能力测试,不需要 cc-connect 重复覆盖。
- Blast radius: 仅
agent/codex/和core/engine.go的/reasoning命令渲染路径;对其他 agent / platform 无影响。
Next step:
- 建议 owner 直接 merge。Reasonable feature extension,scope 小,i18n 同步完整。可以现在合。
- post-merge 验证: 用真实 Codex CLI 0.144+ 跑
/reasoning max和/reasoning ultra,确认 Codex 接受且 cc-connect 显示 usage 时列出 8 个 level。
AaronZ345
force-pushed
the
agent/codex-gpt56-reasoning-efforts-20260809
branch
from
August 13, 2026 14:44
a2052c9 to
110ce76
Compare
AaronZ345
force-pushed
the
agent/codex-gpt56-reasoning-efforts-20260809
branch
from
August 14, 2026 14:43
110ce76 to
5e453d5
Compare
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.
Supersedes #1519. This is the same patch on a fresh branch after the 30-day maintenance gate; the prior PR had no requested changes or unresolved review threads.
Summary
none,minimal,max, andultraas Codex reasoning efforts/reasoningand/effortusage text from the active agent instead of hardcoding four levelsconfig.example.tomlRelation to #1547
#1547 already fixed GPT-5.x discovery from
/v1/modelsby replacing the stale allowlist withisCodexChatModel. This PR leaves that filter unchanged.The remaining model change here is limited to
defaultCodexModels(), the final offline fallback. The duplicate GPT-5.6 API test has also been removed; the upstreamcodex_model_test.gosuite now owns API-filter coverage.The reasoning changes are separate from model discovery. Codex CLI 0.144 accepts the newer levels, but cc-connect previously normalized values beyond
xhighto an empty string and showed a stale four-level usage message.Validation
go test ./agent/codex -count=1go test ./core -run "TestCmdReasoning_UsageListsAgentEfforts|TestCmdReasoning_SwitchesEffortAndResetsSession" -count=1go test -tags no_web ./cmd/cc-connect ./core ./agent/codex -count=1git diff --check