mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 23:01:30 +00:00
`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> |
||
|---|---|---|
| .. | ||
| agent | ||
| ai | ||
| coding-agent | ||
| mom | ||
| pods | ||
| tui | ||
| web-ui | ||