Skip to content

fix: read config.toml service_tier for inherited service mode - #1771

Open
Rat0323 wants to merge 2 commits into
BigPizzaV3:mainfrom
Rat0323:fix/service-tier-inherit-label
Open

fix: read config.toml service_tier for inherited service mode#1771
Rat0323 wants to merge 2 commits into
BigPizzaV3:mainfrom
Rat0323:fix/service-tier-inherit-label

Conversation

@Rat0323

@Rat0323 Rat0323 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

问题

服务模式面板在「继承」状态下此前显示 继承 config.toml:standard,但实现只读取 Codex 桌面状态 default-service-tier,从不解析 config.toml。当该状态项不存在时会被误显示为 Standard——即使 config.toml 里实际写了 service_tier = "fast",请求也不会带上 priority,与提示语完全不符。

修复

后端(真实读取 config.toml)

  • model_catalog.rs 现在在 /codex-model-catalog 响应中新增 service_tier 字段,返回 config.toml(含 profile 覆盖)里生效的 service_tier;未配置时为 null

  • 复用现有的 config 解析逻辑,无新增 I/O 通道。

注入脚本(继承语义修正)

  • 继承模式的读取顺序:优先 Codex 应用内设置(default-service-tier),其次 config.tomlservice_tier,两者都缺失才显示「默认」。
  • 状态文案按来源标注:继承 Codex 默认设置:…继承 config.toml:…,不再猜成 Standard。
  • 继承到的 fast 值现在会真正参与请求注入(codexServiceTierInheritedValue),并保留原有的模型支持门控:不支持 Fast 的模型仍会被拦回 Standard。
  • 全局/自定义模式的行为不变。

测试

  • 新增 model_catalog_reports_effective_service_tier_from_config / model_catalog_service_tier_is_null_when_config_does_not_set_it
  • Node harness 增加:config.toml 来源状态文案、resolveInheritedServiceTier 的分辨结果(config-toml / 未设置)、继承 config fast 但模型不支持时的拦截。
  • 验证:cargo test -p codex-plus-core --test cdp_bridge --test model_catalog --test bridge_routes 全部通过(103 tests)。

@Rat0323
Rat0323 force-pushed the fix/service-tier-inherit-label branch from f5a4857 to 918756c Compare August 4, 2026 19:23
Inherit mode previously only read the Codex desktop state key default-service-tier and mislabeled the result as coming from config.toml. Now the backend model catalog reports the effective service_tier parsed from config.toml (profile-aware), and the renderer resolves the inherited tier from the Codex app setting first, then config.toml, labeling the source accordingly. Inherited fast requests are still gated by model support before service_tier is injected.
@Rat0323
Rat0323 force-pushed the fix/service-tier-inherit-label branch from 918756c to 7bb595b Compare August 4, 2026 21:25
@Rat0323 Rat0323 changed the title fix: clarify inherited service tier status fix: read config.toml service_tier for inherited service mode Aug 4, 2026
Mirror PR BigPizzaV3#1735 so byte-exact upstream theme asset tests pass on Windows checkouts; this commit becomes a no-op once BigPizzaV3#1735 merges.
@Rat0323
Rat0323 force-pushed the fix/service-tier-inherit-label branch from 7bb595b to 1235aab Compare August 4, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant