mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 06:12:10 +03:00
fix(antigravity): don't inject default maxOutputTokens when client omits max_tokens
Real Antigravity client does not send maxOutputTokens when the user hasn't specified it — the Cloud Code server decides the output limit. OmniRoute was incorrectly injecting a capped default from model specs, which caused thinking models to return empty content with low limits.
This commit is contained in:
@@ -567,7 +567,17 @@ export function openaiToAntigravityRequest(model, body, stream, credentials = nu
|
||||
}
|
||||
|
||||
const geminiCLI = openaiToGeminiCLIRequest(model, body, stream);
|
||||
return wrapInCloudCodeEnvelope(model, geminiCLI, credentials, true);
|
||||
const envelope = wrapInCloudCodeEnvelope(model, geminiCLI, credentials, true);
|
||||
|
||||
// Match real Antigravity client: don't send maxOutputTokens when the user
|
||||
// hasn't explicitly specified max_tokens / max_completion_tokens.
|
||||
// The Cloud Code server decides the output limit on its own.
|
||||
const clientRequestedMaxTokens = body.max_tokens ?? body.max_completion_tokens;
|
||||
if (clientRequestedMaxTokens === undefined && envelope.request?.generationConfig) {
|
||||
delete envelope.request.generationConfig.maxOutputTokens;
|
||||
}
|
||||
|
||||
return envelope;
|
||||
}
|
||||
|
||||
// Register
|
||||
|
||||
Reference in New Issue
Block a user