Commit e4a5c1d
authored
🤖 fix: strip unsupported truncation from Codex OAuth requests (#3153)
## Summary
Strip the unsupported `truncation` field from Codex OAuth Responses
requests before rerouting them to ChatGPT's Codex backend.
## Background
A recent regression in Mike's `2662aedd8` change (`🤖 fix: align GitHub
Copilot model routing (#3104)`) started preserving OpenAI's `truncation`
field inside `normalizeCodexResponsesBody()`. A user then hit the
backend error:
```json
{ "detail": "Unsupported parameter: truncation" }
```
The public OpenAI Responses API accepts `truncation`, but the ChatGPT
Codex endpoint used by OAuth
(`https://chatgpt.com/backend-api/codex/responses`) does not.
## Implementation
- remove `truncation` from the Codex-compatible allowlist
- explicitly delete `json.truncation` during Codex request normalization
- update the regression tests to assert that Codex-normalized bodies
strip `truncation`
- clarify the fetch-wrapper comments so they describe Codex request
normalization instead of defaulting truncation
## Validation
- `bun test src/node/services/providerModelFactory.test.ts`
- `bun test src/node/services/codexOauthService.test.ts`
- `make static-check`
## Risks
Low. The change only affects the Codex OAuth request-normalization path
and restores the pre-regression behavior for a field that the target
endpoint rejects.
---
_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` •
Cost: `$1.79`_
<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=1.79 -->1 parent 257f440 commit e4a5c1d
2 files changed
Lines changed: 22 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | 665 | | |
667 | 666 | | |
668 | 667 | | |
| |||
693 | 692 | | |
694 | 693 | | |
695 | 694 | | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
700 | 699 | | |
701 | 700 | | |
702 | 701 | | |
| |||
1185 | 1184 | | |
1186 | 1185 | | |
1187 | 1186 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1191 | 1190 | | |
1192 | 1191 | | |
1193 | 1192 | | |
| |||
1218 | 1217 | | |
1219 | 1218 | | |
1220 | 1219 | | |
1221 | | - | |
| 1220 | + | |
| 1221 | + | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
| 1284 | + | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
| |||
0 commit comments