Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new dispatch model_info.context_length / max_completion_tokens fields are not normalized from inputTokenLimit / outputTokenLimit, so many Gemini catalog entries would omit the fields the consumer/tests appear to rely on.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the RESP dispatch (“pop dynamic”) response payload to optionally include selected model capability metadata (model_info) so CPA nodes can make execution-time decisions with more context about the chosen model.
Changes:
- Add
model_infoto the dispatch response JSON when available. - Introduce
home.DispatchModelInfoand populate it during dispatch via a registry lookup scoped to the selected auth/client. - Add tests covering
model_infopropagation and registry-derived capability selection.
File summaries
| File | Description |
|---|---|
| internal/respserver/pop/dynamic/dispatch.go | Includes model_info in the prepared dispatch response payload. |
| internal/respserver/pop/dynamic/concurrency_dispatch_test.go | Adds test asserting model_info is present in both accounted/unaccounted responses. |
| internal/registry/model_registry.go | Adds GetModelInfoForClient helper to fetch a client-scoped model definition. |
| internal/home/runtime.go | Extends DispatchResult with ModelInfo and defines DispatchModelInfo payload shape. |
| internal/home/models.go | Adds dispatchModelInfoForAuth to select/copy model capability metadata for dispatch. |
| internal/home/models_resolver_test.go | Adds test validating dispatch model info uses the selected registry capabilities. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+153
to
+167
| modelID := coreauth.CanonicalModelID(upstreamModel) | ||
| if modelID == "" { | ||
| modelID = coreauth.CanonicalModelID(selected.ID) | ||
| } | ||
| return &DispatchModelInfo{ | ||
| ID: modelID, | ||
| Type: selected.Type, | ||
| InputTokenLimit: selected.InputTokenLimit, | ||
| OutputTokenLimit: selected.OutputTokenLimit, | ||
| ContextLength: selected.ContextLength, | ||
| MaxCompletionTokens: selected.MaxCompletionTokens, | ||
| Thinking: selected.Thinking, | ||
| UserDefined: selected.UserDefined, | ||
| } | ||
| } |
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.
No description provided.