fix(opencode): patch gcp metadata warning leak (#29431)

This commit is contained in:
Aiden Cline
2026-05-26 12:18:09 -05:00
committed by GitHub
parent 034298cb1f
commit 797359fbf0
3 changed files with 18 additions and 2 deletions
+14
View 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.