Skip to content

fix: clear relay context limits for official mode - #2159

Open
yytw21 wants to merge 1 commit into
BigPizzaV3:mainfrom
yytw21:fix/official-context-reset
Open

fix: clear relay context limits for official mode#2159
yytw21 wants to merge 1 commit into
BigPizzaV3:mainfrom
yytw21:fix/official-context-reset

Conversation

@yytw21

@yytw21 yytw21 commented Sep 11, 2026

Copy link
Copy Markdown

问题

从中转 provider 切换到纯官方登录时,clear_relay_config_to_home_with_auth() 会移除 model_catalog_json,但会保留此前中转写入的 model_context_windowmodel_auto_compact_token_limit

例如中转站 A 使用 256K 上下文后,切换到官方模式仍可能继续使用该全局上限,而不是恢复官方模式自己的配置。

修改

在清理纯官方模式的中转配置时,同时移除:

  • model_context_window
  • model_auto_compact_token_limit

并扩展现有回归测试,验证 256K 中转上下文与自动压缩阈值均会被清理。

验证

cargo test -p codex-plus-core --test relay_config clear_relay_config_removes_model_provider_and_preserves_other_config

结果:1 passed; 0 failed

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