Skip to content

feat(dispatch): include model info in responses - #109

Merged
luispater merged 1 commit into
devfrom
models
Sep 3, 2026
Merged

feat(dispatch): include model info in responses#109
luispater merged 1 commit into
devfrom
models

Conversation

@hkfires

@hkfires hkfires commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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_info to the dispatch response JSON when available.
  • Introduce home.DispatchModelInfo and populate it during dispatch via a registry lookup scoped to the selected auth/client.
  • Add tests covering model_info propagation 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 thread internal/home/models.go
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,
}
}
@luispater
luispater merged commit 75d80dd into dev Sep 3, 2026
3 checks passed
@luispater
luispater deleted the models branch September 3, 2026 08:32
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.

3 participants