clawmoney 0.13.9 → 0.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -536,28 +536,33 @@ async function doCallAntigravityApi(opts) {
|
|
|
536
536
|
if (upstreamModel !== opts.model) {
|
|
537
537
|
logger.info(`[antigravity-api] model mapping: ${opts.model} → ${upstreamModel}`);
|
|
538
538
|
}
|
|
539
|
+
// Request shape mirrors sub2api's minimal inner GeminiRequest: contents +
|
|
540
|
+
// toolConfig + sessionId. generationConfig is optional and only gets set
|
|
541
|
+
// when the caller actually supplied max_tokens — sending a bare
|
|
542
|
+
// maxOutputTokens in the inner request against v1internal has been
|
|
543
|
+
// observed to return "500 Unknown Error" for some models.
|
|
544
|
+
const innerRequest = {
|
|
545
|
+
contents: [
|
|
546
|
+
{
|
|
547
|
+
role: "user",
|
|
548
|
+
parts: [{ text: prompt }],
|
|
549
|
+
},
|
|
550
|
+
],
|
|
551
|
+
toolConfig: {
|
|
552
|
+
functionCallingConfig: { mode: "VALIDATED" },
|
|
553
|
+
},
|
|
554
|
+
sessionId: generateStableSessionId(prompt),
|
|
555
|
+
};
|
|
539
556
|
const outerRequest = {
|
|
540
557
|
project: projectId,
|
|
541
558
|
requestId: `agent-${randomUUID()}`,
|
|
542
559
|
userAgent: "antigravity",
|
|
543
560
|
requestType: "agent",
|
|
544
561
|
model: upstreamModel,
|
|
545
|
-
request:
|
|
546
|
-
contents: [
|
|
547
|
-
{
|
|
548
|
-
role: "user",
|
|
549
|
-
parts: [{ text: prompt }],
|
|
550
|
-
},
|
|
551
|
-
],
|
|
552
|
-
generationConfig: {
|
|
553
|
-
maxOutputTokens: maxTokens,
|
|
554
|
-
},
|
|
555
|
-
toolConfig: {
|
|
556
|
-
functionCallingConfig: { mode: "VALIDATED" },
|
|
557
|
-
},
|
|
558
|
-
sessionId: generateStableSessionId(prompt),
|
|
559
|
-
},
|
|
562
|
+
request: innerRequest,
|
|
560
563
|
};
|
|
564
|
+
// Suppress unused-var lint while we keep maxTokens around for future use.
|
|
565
|
+
void maxTokens;
|
|
561
566
|
const bodyJson = JSON.stringify(outerRequest);
|
|
562
567
|
let transientAttempt = 0;
|
|
563
568
|
let hasRefreshed = false;
|