Skip to content

[aw-failures] [fix] Gemini router selects unpriced TTS model (gemini-3.1-flash-tts-preview) -> Smoke Gemini 400 unknown_model_ai_credits #38558

@github-actions

Description

@github-actions

Problem Statement

Fix the Gemini model router — it routes text tasks to gemini-3.1-flash-tts-preview, an unpriced TTS preview model, breaking every Smoke Gemini run. Each run fails on the first API call with status 400 unknown_model_ai_credits (0 tokens, 0 tool calls), so the Gemini engine smoke test is fully blocked.

Affected Workflows & Run IDs

Root Cause

The model router (NumericalClassifierStrategy.routeModelRouterService.route) selects gemini-3.1-flash-tts-preview (a text-to-speech preview model) for a normal text task. That model has no AI-credits pricing entry and no apiProxy.defaultAiCreditsPricing fallback, so the AWF proxy rejects the first generateContent/generateContentStream call:

[API Error: {"type":"unknown_model_ai_credits","message":"Model \"gemini-3.1-flash-tts-preview\" has no AI credits pricing and no default pricing is configured...","model":"gemini-3.1-flash-tts-preview"}]
status: 400

Configured text models for the run were gemini-2.5-flash-lite and gemini-3.1-pro-preview — the TTS model should never have been selected.

Proposed Remediation

  1. Primary: Exclude TTS/audio preview models (e.g. *-tts-preview) from the text model router so text tasks never resolve to gemini-3.1-flash-tts-preview.
  2. Defense-in-depth: Add gemini-3.1-flash-tts-preview to the AWF pricing table, or set apiProxy.defaultAiCreditsPricing (e.g. {"input":3.0,"output":15.0}) so an unpriced model degrades gracefully instead of a hard 400.

Success Criteria / Verification

  • Smoke Gemini completes without unknown_model_ai_credits/status 400 on the first call.
  • Router unit/integration test asserts a text task never resolves to a *-tts* model.
  • A re-run of Smoke Gemini on a PR branch reports non-zero tokens and reaches tool execution.

Parent: #38556. Analyzed runs: 27331325693, 27329688408, 27327422881, 27320398264.
Related to #38556

Generated by 🔍 [aw] Failure Investigator (6h) · 371.2 AIC · ⌖ 11.8 AIC · ⊞ 5.1K ·

  • expires on Jun 18, 2026, 12:40 AM UTC-08:00

Failure Investigator (6h) — fresh evidence (window 08:13Z–14:13Z, 2026-06-11)

  1. The router defect tracked here is still active. Two additional Smoke Gemini failures occurred inside this 6h window, both with the identical signature (gemini-3.1-flash-tts-previewunknown_model_ai_credits, status: 400):
  2. Per-run evidence (gh api .../jobs/<id>/logs): each failed agent job logged the string unknown_model_ai_credits 4× and no AI credits pricing for model gemini-3.1-flash-tts-preview.
  3. audit of 27346208956: conclusion=failure, error_count=1, 0 turns, narrow tool breadth — the run dies on the first generateContent call before any tool use (matches the original cluster fingerprint).
  4. audit-diff (base 27327422881 vs compare 27346208956): run1_token_usage=0, run2_token_usage=0, no behavioral drift. The failure mechanism is unchanged — same root cause, no regression introduced.
  5. The 2026-06-11 detection commit #38610 (Detect unknown_model_ai_credits failure in conclusion job) added detection only; it did not modify the model router. The router still resolves text tasks to the TTS preview model, so the P0 remediation in this issue (exclude *-tts* from the text router + pricing/default-pricing fallback) remains required and unfixed.

Tooling note (data gap)

The deterministic pre-fetch payload for this run reported failures: [] and failed_run_ids: [], missing both in-window Smoke Gemini failures above. They run on PR/copilot/* branches; the pre-fetch appears scoped to scheduled/main runs. Pre-fetch failure discovery should include PR-branch runs so Smoke-engine regressions are not silently dropped.

Status: still failing — keep open. No new tracking issue created; this cluster is fully covered here.

Generated by 🔍 [aw] Failure Investigator (6h) · 165.4 AIC · ⌖ 11.3 AIC · ⊞ 5.1K ·

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions