Conversation
|
This pull request targeted The base branch has been automatically changed to |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Home-enabled model-list routes bypass the updated handlers and still omit the new context metadata.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Corrects Gemini image context metadata and exposes context limits across model-list formats.
Changes:
- Corrects seven embedded Gemini image context limits.
- Adds cross-format context-limit fallbacks.
- Exposes and tests context fields in OpenAI and Gemini responses.
| File | Description |
|---|---|
internal/registry/models/models.json |
Corrects Gemini image context metadata. |
internal/registry/model_registry.go |
Adds provider-field fallbacks. |
internal/registry/model_context_metadata_test.go |
Tests registry conversions. |
sdk/api/handlers/openai/openai_handlers.go |
Exposes OpenAI context fields. |
sdk/api/handlers/openai/openai_models_context_test.go |
Tests OpenAI output. |
sdk/api/handlers/gemini/gemini_models_display_name_test.go |
Tests Gemini context output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1730
to
+1733
| resolvedInputTokenLimit := model.InputTokenLimit | ||
| if resolvedInputTokenLimit <= 0 { | ||
| resolvedInputTokenLimit = model.ContextLength | ||
| } |
Comment on lines
+99
to
+103
| if contextLength, exists := model["context_length"]; exists { | ||
| filteredModel["context_length"] = contextLength | ||
| } | ||
| if maxContextLength, exists := model["max_context_length"]; exists { | ||
| filteredModel["max_context_length"] = maxContextLength |
| "version": "3.1", | ||
| "description": "Gemini 3.1 Flash Image Preview", | ||
| "inputTokenLimit": 1048576, | ||
| "inputTokenLimit": 131072, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Mirror the Gemini image context corrections from router-for-me/models#74 in the embedded catalog. The current model catalog already lists
gemini-3.8-flashat Google's documented 1,048,576-token window.The registry now uses
inputTokenLimitwhen an entry lackscontext_length, and vice versa for Gemini model responses. The plain OpenAI-compatible/v1/modelsresponse now includes availablecontext_lengthandmax_context_lengthfields, so clients do not have to guess a generic window. Claude-format model responses also use the Gemini input limit whencontext_lengthis absent.Sources
Validation
go test ./internal/registry ./sdk/api/handlers/openai ./sdk/api/handlers/gemini -count=1passed.go build -o <temporary output> ./cmd/serverpassed.git diff --checkpassed.This PR targets v8 main. The locally installed VibeProxy binary is v7.3.17 and was not replaced.