qwen-code/docs
Isaac Hernández fd9c452dc8
fix(auth): let Vertex AI authenticate with Application Default Credentials (#9017)
* fix(auth): let Vertex AI authenticate with Application Default Credentials

Vertex AI auth required an API key, so an ADC or service account setup
could not start. Supplying a placeholder to satisfy the check made it
worse: an explicitly passed key switches the Google SDK to Vertex
Express mode, which clears the project and location and rejects the
request with "API keys are not supported by this API".

Treat a configured GOOGLE_CLOUD_PROJECT as sufficient credentials for
the vertex-ai auth type, in both the CLI pre-flight check and the core
model config validation, and leave the API key absent so the SDK
resolves ADC itself. The missing-credentials errors now mention the
keyless path instead of pointing only at envKey.

Fixes #9016

* fix(auth): select Vertex mode explicitly and keep declared key vars authoritative

Review follow-ups on the Vertex ADC change.

Vertex mode no longer depends on the GOOGLE_GENAI_USE_VERTEXAI side effect.
Only the CLI pre-flight check writes that variable, and the startup call to it
sits under the sandbox branch, so a plain interactive or ACP session built a
client pointed at the Gemini API endpoint instead of Vertex. The flag is now
derived from the auth type at construction, and left untouched for the other
auth types so the SDK keeps its own environment fallback there.

An entry that declares its own key variable no longer falls through to ADC when
that variable is unset. It keeps failing on the declared variable, so a secret
that failed to inject cannot silently authenticate as a different principal.
The keyless hint is suppressed for those entries as well, since it would be
advice that cannot work.

The ACP pre-flight cell reports an indeterminate state for a keyless Vertex
setup rather than a confirmed token: a configured project is routing
configuration, not evidence that a credential resolves. All three gates now
share one definition of a configured project, so whitespace is handled the same
way everywhere, and the CLI missing-key message carries the same keyless hint as
the core errors.

Docs corrected on two counts: the environment-only row now says a keyless setup
must select the auth type explicitly, since it is not inferred from the project
alone, and the provider note names every key source the resolver folds in.

---------

Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
2026-08-23 19:27:16 +00:00
..
assets feat: support workspace display names (#7179) 2026-07-20 15:16:44 +00:00
design fix(web-shell): show reasoning effort before session creation (#9599) 2026-08-23 19:11:19 +00:00
developers feat(mcp): add MCP 2026 core and WebShell Apps host (#8992) 2026-08-23 18:34:30 +00:00
e2e-tests fix(cli): Recover sessions across archive races (#9513) 2026-08-22 14:01:59 +00:00
images fix(web-shell): render built-in tag icons (#7024) 2026-07-17 15:33:34 +00:00
plans feat(cua-driver): add versioned Computer Use SDK and release pipeline (#9587) 2026-08-23 14:20:14 +00:00
superpowers feat(cli): reference prior sessions via @ and add completion tabs (#7302) 2026-07-24 06:11:48 +00:00
users fix(auth): let Vertex AI authenticate with Application Default Credentials (#9017) 2026-08-23 19:27:16 +00:00
verification/abort-controller-refactor fix(core): stop AbortSignal listener leak in long sessions (MaxListenersExceededWarning) (#4366) 2026-05-26 14:21:49 +08:00
_meta.ts feat: refactor docs 2025-12-05 10:51:57 +08:00
index.md fix: lint issues 2025-12-19 15:52:11 +08:00