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