Repository navigation
fix(responses): omit canonical Codex user metadata and hop request-local 400s #4563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c90d66d
fbf49ea
2530f4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,8 @@ Combo failures are divided into **hop** failures and **terminal** failures. | |
| | HTTP 401, 403, 404, 408, 429, or any 5xx | Cool the target and hop to the next eligible target. | | ||
| | HTTP 410 with an explicit model end-of-life, retired, deprecated, sunset, decommissioned, or no-longer-available signal | Cool that target and hop. Unrelated 410 responses remain terminal. | | ||
| | Classified authentication, subscription, quota, rate-limit, overload, or upstream-server error | Cool the target and hop, even when the status alone is not sufficient. | | ||
| | Client cancellation (499), `origin_rejected`, cyber-policy refusal, context overflow, or invalid request | Stop and return the error; another target would not make the request valid. | | ||
| | Client cancellation (499), `origin_rejected`, cyber-policy refusal, context overflow, or other invalid request | Stop and return the error; another target would not make the request valid. | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Distinguish target-local context overflow from terminal invalid input. The runtime hops for provider-target context overflow because another combo target may have a larger context window. These tables classify every context overflow as terminal. Limit the terminal wording to generic request-level overflow and document the target-local hop case.
📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
| | Structured HTTP 400 rejecting optional `user`, an unsupported reasoning effort, or model-scoped image input | Hop before output commitment without cooling; see request-local target compatibility below. | | ||
| | Any other unclassified error | Stop and return the error. | | ||
|
|
||
| When `cooldownMs` is unset, a hopped target uses an upstream fallback: 5 seconds for request-rate | ||
|
|
@@ -227,8 +228,8 @@ fallback for upstream rate-limit codes `1302`/`1305` → the 60-second default. | |
| `Retry-After: 0` remains an immediate upstream directive rather than being replaced by a configured | ||
| cooldown. | ||
|
|
||
| The current request never retries the same attempted target. Later requests skip it until its | ||
| cooldown expires. A `Retry-After` HTTP-date that is already in the past is also preserved as an | ||
| The current request never retries the same attempted target. Later requests skip a cooled target until its | ||
| cooldown expires; request-local compatibility rejections do not cool the target. A `Retry-After` HTTP-date that is already in the past is also preserved as an | ||
| immediate upstream directive, just like `Retry-After: 0`. Set `waitForCooldownMs` to allow a later | ||
| request to wait for the earliest eligible target cooldown, up to that cap on each selection attempt, | ||
| and then make one fresh selection. A request may therefore wait up to `hops × waitForCooldownMs` | ||
|
|
@@ -254,6 +255,12 @@ another provider, which prevents duplicate text and tool execution. If the pre-o | |
| its safety cap without a terminal or output boundary, OpenCodex also commits the current target | ||
| instead of growing memory without a bound. | ||
|
|
||
| ## Request-local target compatibility | ||
|
|
||
| When routing Claude Code to the canonical ChatGPT Codex backend, OpenCodex removes the unsupported top-level `user` metadata field without changing the session/cache key, input messages, tool schemas, or safety identifiers. Public Responses API and noncanonical forward gateways keep that field. | ||
|
|
||
| A combo can also advance after an intact HTTP 400 `invalid_request_error` that specifically rejects `user`, reports `unsupported_value` for `reasoning.effort`/`reasoning_effort`, or reports `param: input` with an exact model-scoped `does not support image inputs` rejection. This is a mismatch for that request, not evidence that the target is unhealthy, so it records no cooldown. This compatibility recovery does not silently change `none` into a different effort or broaden this exception to arbitrary invalid requests. Policy refusals, cancellation and already-committed output remain non-replayable. A single-target request still returns an unresolved upstream rejection. | ||
|
|
||
| ## Default reasoning effort | ||
|
|
||
| `defaultEffort` fills an absent `reasoning.effort` when the combo has a non-null default and the selected target has a known, nonempty supported ladder. If the target supports the configured value, it is retained; otherwise the highest supported rung at or below it is used, or the lowest supported rung when none is lower. Unknown or empty ladders omit the default. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document the model-lifecycle HTTP 410 exception.
The French failure table omits the supported HTTP 410 case where an explicit model end-of-life signal causes a hop and cooldown. Unrelated HTTP 410 responses remain terminal. Add this row before the terminal invalid-request row.
🧰 Tools
🪛 LanguageTool
[typographical] ~203-~203: Caractère d’apostrophe incorrect.
Context: ...uffit pas. | | Annulation client (499),
origin_rejected, refus de cyber-politique, débordement ...(APOS_INCORRECT)
[typographical] ~203-~203: Le préfixe « cyber » est généralement associé au terme qu’il précède.
Context: ...ient (499),
origin_rejected, refus de cyber-politique, débordement de contexte ou autre deman...(PAS_DE_TRAIT_UNION)
🤖 Prompt for AI Agents