Skip to content

fix(agent-server): drop retired Gemini models from /api/model allowlist (#1137) - #1144

Merged
vybe merged 1 commit into
devfrom
feature/1137-gemini-model-allowlist
Jun 11, 2026
Merged

vybe merged 1 commit into
devfrom
feature/1137-gemini-model-allowlist

Conversation

@dolho

@dolho dolho commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up from #1130. The agent-server model endpoints in docker/base-image/agent_server/routers/chat.py still advertised retired Gemini models — a gemini-cli runtime agent could pick one and get a 404 from Google at runtime.

Changes

  • GET /api/model available_models: gemini-2.0-flash → live set [gemini-3-pro, gemini-3-flash, gemini-2.5-pro, gemini-2.5-flash]; note updated.
  • PUT /api/model valid_models: dropped gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash; kept only the four live models. 400 hint updated. The startswith("gemini-") forward-compat fallback is intentionally retained.
  • gemini_runtime.py pricing table: 2.0-flash / 2.0-flash-lite commented as historical — kept so cost calc of older executions still resolves, not offered in the lists.

Decision note

Model set sourced from the runtime's own GEMINI_PRICING table (agent default gemini-3-flash), not the issue's parenthetical guesses (gemini-3.5-flash, gemini-3-flash-preview) — those don't exist in the runtime.

Verification

  • py_compile clean on both files.
  • Base image rebuilt: trinity-agent-base:0.6.0 / :latest.
  • New lists confirmed inside the built image (grep on /app/agent_server/routers/chat.py) — no retired models present.

AC

  • GET /api/model no longer advertises retired models
  • PUT /api/model allowlist contains only currently-available models
  • Base image rebuilt and verified

Related to #1137

🤖 Generated with Claude Code

…1137)

Follow-up from #1130. The agent-server model endpoints still advertised
Gemini models Google has retired, so a gemini-cli runtime agent could
select one and get a 404 from Google at runtime.

- GET /api/model `available_models`: replace the gemini-2.0-flash entry
  with the live set — gemini-3-pro, gemini-3-flash, gemini-2.5-pro,
  gemini-2.5-flash; update the note accordingly.
- PUT /api/model `valid_models` allowlist: drop gemini-2.0-flash,
  gemini-1.5-pro, gemini-1.5-flash; keep only the four live models.
  Update the 400 error hint. The `startswith("gemini-")` forward-compat
  fallback is retained intentionally.
- gemini_runtime.py pricing table: comment the 2.0-flash / 2.0-flash-lite
  entries as historical — kept only so cost calc of older executions
  still resolves, not offered in the lists.

Model set sourced from the runtime's own GEMINI_PRICING table (default
gemini-3-flash), not the issue's parenthetical guesses. Base image
rebuilt (trinity-agent-base:0.6.0/latest); new lists verified inside the
image.

Related to #1137

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dolho
dolho requested a review from vybe June 11, 2026 08:59
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr: focused 2-file fix, CI green, security clean, historical pricing entry correctly retained for cost calc of older executions. Approving.

@vybe
vybe merged commit 59b5bdd into dev Jun 11, 2026
14 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