Skip to content

Commit df4c544

Browse files
committed
fix(compact): route combo compact requests through failover path
When a compact request resolved through a combo, the native-compact fast path sent the request directly to the picked provider without failover. A 429 or 5xx from that target surfaced as an exhausted-retry error to the client instead of advancing to the next combo target. Skip native compact when route.combo is set so the request falls through to the synthetic compaction path, which dispatches through handleResponses → handleComboResponses with full combo failover (cooldown + advanceToNext).
1 parent 91b2c4e commit df4c544

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎src/server/responses/compact.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,13 @@ export async function handleResponsesCompact(
553553
}
554554
}
555555

556-
// Native /responses/compact exists on the canonical ChatGPT backend and on the
557-
// official OpenAI API. Any other Responses-shaped gateway must take the routed
558-
// summarizer path below, or compaction fails against an endpoint it never had (#422).
559-
if (supportsNativeResponsesCompactEndpoint(route.providerName, route.provider) && !accountGatedCompactWireModel) {
556+
// Native /responses/compact exists on the canonical ChatGPT backend and on the
557+
// official OpenAI API. Any other Responses-shaped gateway must take the routed
558+
// summarizer path below, or compaction fails against an endpoint it never had (#422).
559+
// Combo-resolved targets skip native compact so failover can advance through the
560+
// combo target list when the picked model returns 429/5xx — the routed path below
561+
// dispatches through handleResponses → handleComboResponses with full failover.
562+
if (supportsNativeResponsesCompactEndpoint(route.providerName, route.provider) && !accountGatedCompactWireModel && !route.combo) {
560563
if (req.signal.aborted) {
561564
return formatErrorResponse(499, "client_cancelled", "Client cancelled compact request");
562565
}

0 commit comments

Comments
 (0)