mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 16:56:16 +08:00
5c39dfbfbe
- Update Codex OAuth presets to the gpt-5.6 family (haiku -> gpt-5.6-luna) and bump the custom Codex template default model - Inject CLAUDE_CODE_MAX_CONTEXT_TOKENS / CLAUDE_CODE_AUTO_COMPACT_WINDOW (372000, the ChatGPT Codex catalog window with a ~353K effective budget, openai/codex#31860) into effective live settings so Claude Code stops assuming a 200K window and compacts before the upstream rejects the prompt - Gate the injected defaults on every configured model being gpt-5.6*: gpt-5.5's upstream catalog oscillates between 272K and 372K and must not inherit them; explicit user values always win - Strip the injected values on switch-away backfill (mirror-inverse of the injection conditions) so program defaults never harden into per-provider explicit values, and keep both keys out of the shared common-config snippet
31 lines
581 B
TypeScript
31 lines
581 B
TypeScript
/**
|
|
* Codex 配置模板
|
|
* 用于新建自定义供应商时的默认配置
|
|
*/
|
|
|
|
export interface CodexTemplate {
|
|
auth: Record<string, any>;
|
|
config: string;
|
|
}
|
|
|
|
/**
|
|
* 获取 Codex 自定义模板
|
|
* @returns Codex 模板配置
|
|
*/
|
|
export function getCodexCustomTemplate(): CodexTemplate {
|
|
const config = `model_provider = "custom"
|
|
model = "gpt-5.6"
|
|
model_reasoning_effort = "high"
|
|
disable_response_storage = true
|
|
|
|
[model_providers.custom]
|
|
name = "custom"
|
|
wire_api = "responses"
|
|
requires_openai_auth = true`;
|
|
|
|
return {
|
|
auth: { OPENAI_API_KEY: "" },
|
|
config,
|
|
};
|
|
}
|