Commit 7ebd735
committed
fix(codex): strip Responses-Lite private header upstream
Root cause: Codex Desktop sends x-openai-internal-codex-responses-lite to its local backend as an internal client/backend capability signal. CCSwitchMulti rebuilds request headers and previously default-passed unknown headers to the real upstream, so official ChatGPT Codex and third-party OpenAI-compatible upstreams could receive the private Lite switch. After OpenAI tightened that path for gpt-5.5, the upstream rejects requests with HTTP 400: This model is not supported when using X-OpenAI-Internal-Codex-Responses-Lite.\n\nFix the boundary in the proxy forwarder instead of changing MultiRouter, catalog schema, or provider UI. The header policy now strips only the known Codex Responses-Lite private header before default passthrough. OAuth account/session/cache headers keep their existing behavior, preserving the login-stability work from the v3.16.3-23 line and avoiding broad header scrubbing.\n\nThe same fix was first prepared for upstream cc-switch on branch codex/strip-codex-responses-lite-header and submitted as farion1231#4727.\n\nTests added in forwarder cover official chatgpt.com Codex upstream stripping, third-party upstream stripping, and ordinary header preservation. memory.md records the root cause and future regression boundary.\n\nVerified:\n- cargo fmt --manifest-path src-tauri\\Cargo.toml --check\n- cargo test --manifest-path src-tauri\\Cargo.toml codex_responses_lite_header --lib\n- cargo test --manifest-path src-tauri\\Cargo.toml ordinary_headers_are_preserved_for_upstream --lib\n- git diff --check1 parent fa32a34 commit 7ebd735
2 files changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1976 | 1976 | | |
1977 | 1977 | | |
1978 | 1978 | | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
1979 | 1986 | | |
1980 | 1987 | | |
1981 | 1988 | | |
| |||
3012 | 3019 | | |
3013 | 3020 | | |
3014 | 3021 | | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
3015 | 3037 | | |
3016 | 3038 | | |
3017 | 3039 | | |
| |||
3447 | 3469 | | |
3448 | 3470 | | |
3449 | 3471 | | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
3450 | 3505 | | |
3451 | 3506 | | |
3452 | 3507 | | |
| |||
0 commit comments