co-mono/packages
jeremiahgaylord-web cf656c169c
fix(ai): don't cache false for Vertex ADC credentials during async import race (#1550)
`hasVertexAdcCredentials()` uses dynamic imports to load `node:fs`,
`node:os`, and `node:path` to avoid breaking browser/Vite builds. These
imports are fired eagerly but resolve asynchronously. If the function is
called during gateway startup before those promises resolve, `_existsSync`,
`_homedir`, and `_join` are still null — causing the function to cache
`false` permanently and never re-evaluate.

This means users with valid `GOOGLE_APPLICATION_CREDENTIALS`,
`GOOGLE_CLOUD_PROJECT`, and `GOOGLE_CLOUD_LOCATION` configured are silently
treated as unauthenticated for Vertex AI. Calls fall back to the AI Studio
endpoint (generativelanguage.googleapis.com) which has much stricter rate
limits, causing unexpected 429 errors even though Vertex credentials are
correctly configured.

Fix: in Node.js/Bun environments, return false without caching when the
async modules aren't loaded yet, so the next call retries. Only cache false
permanently in browser environments where `fs` is genuinely unavailable.

Co-authored-by: Jeremiah Gaylord <jeremiahgaylord-web@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 00:31:16 +01:00
..
agent Add [Unreleased] section for next cycle 2026-02-24 23:52:43 +01:00
ai fix(ai): don't cache false for Vertex ADC credentials during async import race (#1550) 2026-02-26 00:31:16 +01:00
coding-agent fix(subagent): use getAgentDir for user agents path (#1559) 2026-02-26 00:22:42 +01:00
mom Add [Unreleased] section for next cycle 2026-02-24 23:52:43 +01:00
pods Release v0.55.0 2026-02-24 23:52:01 +01:00
tui fix(tui): load koffi via createRequire in ESM (#1627) 2026-02-25 12:05:27 +01:00
web-ui Add [Unreleased] section for next cycle 2026-02-24 23:52:43 +01:00