@expiren/opencode-antigravity-auth 1.6.48 → 1.6.50
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 +20 -2
- package/dist/index.js.map +2 -2
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +27 -2
- package/dist/src/plugin.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12734,10 +12734,22 @@ var createAntigravityPlugin = (providerId) => async ({ client, directory }) => {
|
|
|
12734
12734
|
if (!bodyStr) return;
|
|
12735
12735
|
try {
|
|
12736
12736
|
pushDebug("cache-warmup-probe: start");
|
|
12737
|
+
let probeBody = bodyStr;
|
|
12738
|
+
try {
|
|
12739
|
+
const parsed = JSON.parse(bodyStr);
|
|
12740
|
+
if (parsed.request && typeof parsed.request === "object") {
|
|
12741
|
+
const req = { ...parsed.request };
|
|
12742
|
+
delete req.generationConfig;
|
|
12743
|
+
delete req.thinkingConfig;
|
|
12744
|
+
delete req.safetySettings;
|
|
12745
|
+
probeBody = JSON.stringify({ ...parsed, request: req });
|
|
12746
|
+
}
|
|
12747
|
+
} catch {
|
|
12748
|
+
}
|
|
12737
12749
|
const probeResponse = await fetch(toUrlString(prepared.request), {
|
|
12738
12750
|
...prepared.init,
|
|
12739
12751
|
method: "POST",
|
|
12740
|
-
body:
|
|
12752
|
+
body: probeBody
|
|
12741
12753
|
});
|
|
12742
12754
|
if (probeResponse.body) {
|
|
12743
12755
|
const reader = probeResponse.body.getReader();
|
|
@@ -12746,7 +12758,13 @@ var createAntigravityPlugin = (providerId) => async ({ client, directory }) => {
|
|
|
12746
12758
|
}
|
|
12747
12759
|
const status = probeResponse.status;
|
|
12748
12760
|
if (status >= 400) {
|
|
12749
|
-
|
|
12761
|
+
let errorSnippet = "";
|
|
12762
|
+
try {
|
|
12763
|
+
const errText = await probeResponse.text().catch(() => "");
|
|
12764
|
+
errorSnippet = errText.slice(0, 200);
|
|
12765
|
+
} catch {
|
|
12766
|
+
}
|
|
12767
|
+
pushDebug(`cache-warmup-probe: done status=${status}${errorSnippet ? ` error=${errorSnippet}` : ""}`);
|
|
12750
12768
|
} else {
|
|
12751
12769
|
pushDebug(`cache-warmup-probe: done status=${status} (aborted after first chunk)`);
|
|
12752
12770
|
}
|