This commit is contained in:
decolua
2026-06-21 18:01:33 +07:00
parent d4ecad24d3
commit d9b9a192ef

View File

@@ -29,6 +29,11 @@ const ANTIGRAVITY_REQUEST_BLACKLIST = [
"thinkingConfig",
];
// Strip blacklisted fields from an object (used for both body.request and top-level body)
const stripBlacklisted = obj => {
for (const key of ANTIGRAVITY_REQUEST_BLACKLIST) delete obj[key];
};
// Image generation model name patterns
const IMAGE_MODEL_PATTERNS = [
/image/i,
@@ -179,7 +184,7 @@ export class AntigravityExecutor extends BaseExecutor {
// Strip tools/toolConfig (handled separately) and blacklisted fields that Google rejects
const { tools: _originalTools, toolConfig: _originalToolConfig, ...requestWithoutTools } = body.request || {};
for (const key of ANTIGRAVITY_REQUEST_BLACKLIST) delete requestWithoutTools[key];
stripBlacklisted(requestWithoutTools);
const generationConfig = { ...(requestWithoutTools.generationConfig || {}) };
if (generationConfig.maxOutputTokens > MAX_ANTIGRAVITY_OUTPUT_TOKENS) {
generationConfig.maxOutputTokens = MAX_ANTIGRAVITY_OUTPUT_TOKENS;
@@ -195,6 +200,9 @@ export class AntigravityExecutor extends BaseExecutor {
...(tools?.length > 0 && { toolConfig: { functionCallingConfig: { mode: "VALIDATED" } } })
};
// Strip blacklisted thinking fields from top-level body (set by thinkingUnified.js at root, not body.request)
stripBlacklisted(body);
this._lastSessionId = transformedRequest.sessionId; // cached for buildHeaders (base.execute order)
return {