Repository navigation
fix(codex): 进程级关闭低额度切 luna 的模型 nudge 弹窗 - #1367
Merged
Merged
Conversation
Codex 0.151+ 在主额度用量 ≥90%(剩余<10%,上游 RATE_LIMIT_SWITCH_PROMPT_THRESHOLD=90.0)时弹出 "Switch to <luna> for lower credit usage?" 选择框,第一项 "Switch to <luna>" 是默认选中项。传统粘贴链路在 bracketed paste 后补的提交 Enter 会被该弹窗消费:要么确认切换(模型与 reasoning effort 被静默降级),要么 Enter 被吞导致消息未执行 (submit_unconfirmed),即 issue #1281 记录的弹窗家族之一。 - codex 适配器两条 TUI 启动形态(普通 TUI 与 --remote RPC viewer)均注入 -c notice.hide_rate_limit_model_nudge=true, 等价于弹窗的 "Keep current model (never show again)", 进程级覆盖、不写用户全局 config;app-server/runner 无 TUI 弹窗,不加。 - wrapper 白名单 isBotmuxCodexConfigValue 同步该值,否则 aiden 网关拒收裸 -c 启动失败、cjadk 无法完成 -c→--config 改写。 Co-Authored-By: Claude Code <[email protected]>
stripWrapperUnsafeArgs 的枚举注释只写了 session 环境与启动更新选择器, 补上 #1367 新增的 notice.hide_rate_limit_model_nudge=true。纯注释,无行为变化。 Co-Authored-By: Claude Code <[email protected]>
deepcoldy
approved these changes
Sep 11, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
复审通过:0 阻断,可合。上游真实性、旧版安全、反变异、影响面均已独立验证,CI 13/13 全绿。N1 留 backlog,N2 已修复。
|
🚀 Released in v3.22.0 |
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.
改了什么
Codex CLI 0.151+ 在主额度用量 ≥90%(剩余 <10%,上游常量
RATE_LIMIT_SWITCH_PROMPT_THRESHOLD = 90.0,见codex-rs/tui/src/chatwidget/rate_limits.rs)时,TUI 会弹出 "Approaching rate limits:Switch to gpt-5.6-luna for lower credit usage?" 选择框,三个选项中第一项 "Switch to gpt-5.6-luna" 是默认选中项,裸回车即确认(同时把模型与 reasoning effort 切到 luna 预设)。botmux 传统粘贴链路是「bracketed paste 正文 + ~200ms 后补 Enter」。弹窗存在时该 Enter 被弹窗消费,线上观测到两种表现:
submit_unconfirmed:Enter 被模态框吞掉,正文留在 composer 未提交,消息实际未执行。属于 #1281 记录的「抢 Enter 的弹窗家族」之一(该 issue 已明确列出额度 <10% 切 luna 确认框)。
修复:codex 适配器的两条 TUI 启动形态均在启动参数注入进程级 config 覆盖:
config.schema.json顶层[notice]表;等价于在弹窗选一次 "Keep current model (never show again)",上游edit.rs持久化到同一键路径),只作用于本次进程,不写用户全局 config.toml;--remoteRPC viewer 分支:viewer 自身仍是 TUI、会渲染该弹窗。botmux 虽不向 viewer 注入按键(不可能误确认),但模态框会盖住 pane、干扰屏幕状态检测与 Web 终端人工查看,故与既有的check_for_update_on_startup=false同样在 viewer 上关闭;wrapper 兼容(影响面重点)
src/setup/cli-selection.ts的 botmux 注入参数白名单isBotmuxCodexConfigValue同步加入新值:-c,新值若不进白名单会导致经 aiden 的 codex 启动失败(白名单命中后按既有策略剥离,该路径本就无法传递此类覆盖);-c改写成--config透传;影响面评估
-c key=val不受影响;traex 及其余 20+ CLI 不涉及。/status、以及 botmux 自身的额度/限流结构化通知中看到;不影响 codex 真正耗尽额度后的报错与 botmux 的额度耗尽交接(quota fallback)链路。-c配置键宽松忽略(与既有注入项同一机制),不会启动失败。测试验证
node_modules/.bin/tsc --noEmit通过;vitest run test/cli-adapters.test.ts test/cli-selection.test.ts test/write-input.test.ts:669 passed;vitest runcodex 相关其余 7 个测试文件(rpc-lifecycle / hook-trust / startup-readiness / read-isolation / effort-wiring / trigger-user-shell-env / cli-usage-limit):143 passed;[notice] hide_rate_limit_model_nudge=true配置可被完整加载(正常进入运行阶段),配置路径与官方config.schema.json及上游持久化代码一致;--remoteviewer 参数位置(位于 thread id 之前)、aiden 剥离、cjadk-c→--config改写,并更新全部既有 buildArgs 快照。Refs #1281
🤖 Generated with Claude Code