Skip to content

Stop sending the "auto" model sentinel to the Gemini API - #117

Merged
arancool3000 merged 1 commit into
mainfrom
claude/ember-advanced-data-protection-tks64w
Aug 2, 2026
Merged

arancool3000 merged 1 commit into
mainfrom
claude/ember-advanced-data-protection-tks64w

Conversation

@arancool3000

Copy link
Copy Markdown
Owner
AI error: 404 NOT_FOUND. models/auto is not found for API version v1beta,
or is not supported for generateContent.

Cause

auto is the UI sentinel for "pick the best free model" — the first and default entry in the model dropdown. models.resolve() exists precisely to turn it into a real id. Two call sites skipped it:

mdl = model if model and "claude" not in model.lower() else "gemini-3.1-flash-lite"

"auto" is truthy and contains no "claude", so it fell through the conditional untouched and went to the API as a model name. Anyone who never changed the model picker hit this.

Fix

ai_detect._ask_model and ember_browser's AI helper now route through models.resolve(), which:

  • preserves the original intent — a Claude id means "use the Gemini default here";
  • additionally picks up retired-model remapping, which those two paths never had.

Testing

Covers the resolver, both call sites, and a driven call through ai_detect._ask_model with a stubbed client asserting what would actually have gone over the wire.

Plus a sweep over every module: any model= argument to generate_content must be a literal or explicitly resolved. The next call site that forgets gets caught by the suite rather than by a user — which is how both of these should have been caught.

One test also guards the premise: if the dropdown ever stops offering auto, the rest of the file would be theatre, so it asserts the sentinel is still there and still first.

1379 passed, same 23 pre-existing environment failures.


Generated by Claude Code

    AI error: 404 NOT_FOUND. models/auto is not found for API version v1beta,
    or is not supported for generateContent.

"auto" is the UI sentinel for "pick the best free model" — the first and default
entry in the model dropdown. models.resolve() exists precisely to turn it into a
real id. Two call sites skipped it:

    mdl = model if model and "claude" not in model.lower() else "gemini-3.1-flash-lite"

"auto" is truthy and contains no "claude", so it fell through the conditional
untouched and went to the API as a model name. Anyone who never changed the model
picker hit this.

ai_detect._ask_model and ember_browser's AI helper now route through
models.resolve(), which preserves the original intent — a Claude id means "use
the Gemini default here" — and additionally picks up retired-model remapping,
which those two paths never had.

Tests cover the resolver, both call sites, and a driven call through
ai_detect._ask_model with a stubbed client asserting what would have gone over the
wire. Plus a sweep over every module: any model= argument to generate_content must
be a literal or resolved, so the next call site that forgets is caught by the suite
rather than by a user.

Full suite 1379 passed, same 23 pre-existing environment failures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WebHeGmZb12sW6ZUuyUNix
@arancool3000
arancool3000 merged commit fe17570 into main Aug 2, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants