Summary
Runtime config accepted a malformed agent model id with a doubled provider prefix, which then produced a 404 from the Gemini API at agent-run time.
Details
PATCH /config/ai persisted agent_default_model = google-gla:google-gla:gemini-3-flash-preview (returned 200).
- PydanticAI treated the first
google-gla: as the provider and sent google-gla:gemini-3-flash-preview as the model name.
- Google returned:
404 NOT_FOUND — models/google-gla:gemini-3-flash-preview is not found for API version v1beta, or is not supported for generateContent.
- Net effect: the primary model is unusable until the id is hand-corrected; the failure only surfaces when the agent is invoked (not at config-save time).
Expected
Config validation should reject or normalize a doubled provider prefix in agent_default_model / agent_fallback_model:
- Reject (422) ids where the provider prefix appears more than once (e.g.
google-gla:google-gla:...), or
- Normalize by collapsing a duplicated leading provider prefix.
- Apply to all supported providers (
google-gla, google-vertex, anthropic, openai).
Tests
- Schema-level: validator rejects/normalizes doubled-prefix ids.
- Service-level:
PATCH /config/ai with a doubled prefix returns 422 (or stores the normalized value).
- Route-level: happy path + the doubled-prefix error path.
Context
Found while investigating an experiment-agent stream failure ("All models from FallbackModel failed"). The doubled prefix was the primary-model leg of that failure. Companion issue covers surfacing fallback sub-errors to the UI.
Summary
Runtime config accepted a malformed agent model id with a doubled provider prefix, which then produced a 404 from the Gemini API at agent-run time.
Details
PATCH /config/aipersistedagent_default_model = google-gla:google-gla:gemini-3-flash-preview(returned 200).google-gla:as the provider and sentgoogle-gla:gemini-3-flash-previewas the model name.404 NOT_FOUND — models/google-gla:gemini-3-flash-preview is not found for API version v1beta, or is not supported for generateContent.Expected
Config validation should reject or normalize a doubled provider prefix in
agent_default_model/agent_fallback_model:google-gla:google-gla:...), orgoogle-gla,google-vertex,anthropic,openai).Tests
PATCH /config/aiwith a doubled prefix returns 422 (or stores the normalized value).Context
Found while investigating an experiment-agent stream failure ("All models from FallbackModel failed"). The doubled prefix was the primary-model leg of that failure. Companion issue covers surfacing fallback sub-errors to the UI.