Skip to content

feat: allow custom model ID passthrough for Vertex AI providers#12289

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/vertex-custom-model-id-passthrough
Draft

feat: allow custom model ID passthrough for Vertex AI providers#12289
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/vertex-custom-model-id-passthrough

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 Bot commented May 8, 2026

Related GitHub Issue

Closes: #12232

Description

This PR attempts to address Issue #12232. Feedback and guidance are welcome.

Changes:

  1. Added gemini-3.1-flash-lite-preview to the vertex models list in packages/types/src/providers/vertex.ts with appropriate defaults (1M context window, image support, prompt caching).

  2. Updated VertexHandler.getModel() in src/api/providers/vertex.ts to pass through unknown/custom model IDs with sensible default ModelInfo (8192 max tokens, 1M context window) instead of silently falling back to the default model. This allows users to type any model ID in the UI.

  3. Updated AnthropicVertexHandler.getModel() in src/api/providers/anthropic-vertex.ts with the same custom model ID passthrough behavior (using 200K context window default for Anthropic models).

  4. Added tests for custom model ID passthrough and default fallback in both handlers.

Test Procedure

  • Added unit tests for custom model ID passthrough in vertex.spec.ts (2 new tests)
  • Added unit tests for custom model ID passthrough in anthropic-vertex.spec.ts (2 new tests)
  • All 9 vertex tests pass, all 34 anthropic-vertex tests pass
  • Lint and type-check pass across the full monorepo

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue.
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New tests have been added to cover the changes.
  • Documentation Impact: No documentation updates required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

The approach mirrors how Bedrock handles custom ARNs - unknown model IDs get sensible defaults rather than being silently discarded. This means users can immediately use new model IDs as Google releases them without waiting for extension updates.

Interactively review PR in Roo Code Cloud

- Add gemini-3.1-flash-lite-preview to vertex models list
- Update VertexHandler.getModel() to pass through unknown model IDs
  with sensible default ModelInfo instead of falling back to default model
- Update AnthropicVertexHandler.getModel() with same custom model ID
  passthrough behavior
- Add tests for custom model ID passthrough in both handlers

Closes #12232
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.

Feature Request: Allow custom model ID text input for Vertex AI (or add Gemini 3.1 models)

1 participant