fix(opencode): patch gcp metadata warning leak (#29431)
This commit is contained in:
parent
034298cb1f
commit
797359fbf0
3 changed files with 18 additions and 2 deletions
3
bun.lock
3
bun.lock
|
|
@ -799,8 +799,9 @@
|
||||||
],
|
],
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
|
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
|
||||||
"@ai-sdk/xai@3.0.82": "patches/@ai-sdk%2Fxai@3.0.82.patch",
|
|
||||||
"virtua@0.49.1": "patches/virtua@0.49.1.patch",
|
"virtua@0.49.1": "patches/virtua@0.49.1.patch",
|
||||||
|
"gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch",
|
||||||
|
"@ai-sdk/xai@3.0.82": "patches/@ai-sdk%2Fxai@3.0.82.patch",
|
||||||
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
|
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
|
||||||
"@npmcli/agent@4.0.0": "patches/@npmcli%2Fagent@4.0.0.patch",
|
"@npmcli/agent@4.0.0": "patches/@npmcli%2Fagent@4.0.0.patch",
|
||||||
"@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch",
|
"@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch",
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@
|
||||||
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
|
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
|
||||||
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
|
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
|
||||||
"virtua@0.49.1": "patches/virtua@0.49.1.patch",
|
"virtua@0.49.1": "patches/virtua@0.49.1.patch",
|
||||||
"@ai-sdk/xai@3.0.82": "patches/@ai-sdk%2Fxai@3.0.82.patch"
|
"@ai-sdk/xai@3.0.82": "patches/@ai-sdk%2Fxai@3.0.82.patch",
|
||||||
|
"gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
patches/gcp-metadata@8.1.2.patch
Normal file
14
patches/gcp-metadata@8.1.2.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
diff --git a/build/src/index.js b/build/src/index.js
|
||||||
|
--- a/build/src/index.js
|
||||||
|
+++ b/build/src/index.js
|
||||||
|
@@ -323,6 +323,10 @@ async function isAvailable() {
|
||||||
|
if (process.env.DEBUG_AUTH) {
|
||||||
|
console.info(err);
|
||||||
|
}
|
||||||
|
+ // Promise.any() rejects with AggregateError when neither metadata host
|
||||||
|
+ // is available. This is expected outside GCP, not a warning condition.
|
||||||
|
+ if (err instanceof AggregateError)
|
||||||
|
+ return false;
|
||||||
|
if (err.type === 'request-timeout') {
|
||||||
|
// If running in a GCP environment, metadata endpoint should return
|
||||||
|
// within ms.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue