fix: surface actionable hint when Claude model unavailable on Vertex#486
Open
vildursn wants to merge 1 commit into
Open
fix: surface actionable hint when Claude model unavailable on Vertex#486vildursn wants to merge 1 commit into
vildursn wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When running zeroshot with
CLAUDE_CODE_USE_VERTEX=1, the Claude CLI resolves model shorthands (sonnet,haiku) to versioned Vertex model names (e.g.claude-sonnet-4-5@20250929) that may not be enabled on the user's Vertex deployment. The resulting 404 error was swallowed into a raw JSON blob with no guidance on how to fix it.Changes
detectVertexModelError()to parse the Claude CLI result JSON and identify Vertex model 404 errorslogTaskAttemptFailurenow prints an actionable fix with the exactzeroshot settings setcommand when this error is detectedHookExecutionError) — the model being unavailable is deterministic, so retrying wastes timeAlternatives considered
Option B — Skip
--modelon Vertex: WhenCLAUDE_CODE_USE_VERTEX=1is set and nolevelOverridesare configured, pass no--modelflag and let the CLI use the deployment default. Avoids the error entirely but surrenders model-level control.Option C — Inherit the parent session model: When running under Vertex, the model the parent Claude Code session is using is guaranteed to work. Zeroshot could detect
CLAUDE_CODE_USE_VERTEX=1and default to that model. The challenge is there's no clean way to read which model the parent session resolved to —ANTHROPIC_MODELin the environment is empty even when a model is active.🤖 Generated with Claude Code