@expiren/opencode-antigravity-auth 1.6.45 → 1.6.47
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.
- package/dist/index.js +21 -11
- package/dist/index.js.map +2 -2
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +23 -8
- package/dist/src/plugin.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12734,25 +12734,35 @@ var createAntigravityPlugin = (providerId) => async ({ client, directory }) => {
|
|
|
12734
12734
|
if (!bodyStr) return;
|
|
12735
12735
|
try {
|
|
12736
12736
|
const parsed = JSON.parse(bodyStr);
|
|
12737
|
+
const originalThinking = parsed.generationConfig?.thinkingConfig;
|
|
12737
12738
|
parsed.generationConfig = {
|
|
12738
|
-
maxOutputTokens: 1
|
|
12739
|
+
maxOutputTokens: originalThinking ? 256 : 1,
|
|
12740
|
+
...originalThinking ? { thinkingConfig: { thinkingBudget: 128 } } : {}
|
|
12739
12741
|
};
|
|
12740
|
-
const probeHeaders = new Headers(prepared.init.headers ?? {});
|
|
12741
|
-
probeHeaders.set("accept", "application/json");
|
|
12742
|
-
const probeUrl = toUrlString(prepared.request).replace(
|
|
12743
|
-
":streamGenerateContent?alt=sse",
|
|
12744
|
-
":generateContent"
|
|
12745
|
-
);
|
|
12746
12742
|
pushDebug("cache-warmup-probe: start");
|
|
12747
|
-
const probeResponse = await fetch(
|
|
12743
|
+
const probeResponse = await fetch(toUrlString(prepared.request), {
|
|
12748
12744
|
...prepared.init,
|
|
12749
12745
|
method: "POST",
|
|
12750
|
-
headers: probeHeaders,
|
|
12751
12746
|
body: JSON.stringify(parsed)
|
|
12752
12747
|
});
|
|
12753
|
-
|
|
12748
|
+
let probeBody = "";
|
|
12749
|
+
if (probeResponse.body) {
|
|
12750
|
+
const reader = probeResponse.body.getReader();
|
|
12751
|
+
const decoder = new TextDecoder();
|
|
12752
|
+
let chunk;
|
|
12753
|
+
while (!(chunk = await reader.read()).done) {
|
|
12754
|
+
probeBody += decoder.decode(chunk.value, { stream: true });
|
|
12755
|
+
}
|
|
12756
|
+
} else {
|
|
12757
|
+
probeBody = await probeResponse.text();
|
|
12758
|
+
}
|
|
12754
12759
|
const status = probeResponse.status;
|
|
12755
|
-
|
|
12760
|
+
if (status >= 400) {
|
|
12761
|
+
const errorSnippet = probeBody.slice(0, 200);
|
|
12762
|
+
pushDebug(`cache-warmup-probe: done status=${status} error=${errorSnippet}`);
|
|
12763
|
+
} else {
|
|
12764
|
+
pushDebug(`cache-warmup-probe: done status=${status}`);
|
|
12765
|
+
}
|
|
12756
12766
|
} catch (error) {
|
|
12757
12767
|
pushDebug(
|
|
12758
12768
|
`cache-warmup-probe: failed ${error instanceof Error ? error.message : String(error)}`
|