Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
This repository was archived by the owner on May 24, 2026. It is now read-only.

feat: Adopt ModelCapabilitiesOverride for vision-capable model switching #643

Open

Description

@PureWeen

Context

SDK v0.2.2 added ModelCapabilitiesOverride to ModelApi.SwitchToAsync(). Currently we pass null (PR #641).

Opportunity

When switching to a vision-capable model (e.g., GPT-4o, Claude with vision), we could pass ModelCapabilitiesOverride with:

  • Limits.Vision.SupportedMediaTypes — MIME types the model accepts
  • Limits.Vision.MaxPromptImages — image count limit
  • Limits.Vision.MaxPromptImageSize — size limit per image
  • Limits.MaxContextWindowTokens — context window for the specific model

This would enable the CLI to enforce proper image limits and token budgets per model rather than using server defaults.

Current State

// CopilotService.cs:3316
await state.Session.Rpc.Model.SwitchToAsync(normalizedModel, reasoningEffort, null, cancellationToken);

Priority

Low — only relevant if custom model limits are needed. Server defaults work fine for now.

Activity

  1. github-actions commented on Apr 30, 2026

    @github-actions
    Contributor

    ✅ Agent Fix completed successfully!

  2. added a commit that references this issue on May 1, 2026
    816771b
  3. github-actions commented on May 1, 2026

    @github-actions
    Contributor

    Pull request created: #824

    Generated by Agent Fix

  4. github-actions commented on May 1, 2026

    @github-actions
    Contributor

    Implementation Summary

    PR created to adopt ModelCapabilitiesOverride when switching models mid-session.

    Changes

    1. ModelCapabilities.GetCapabilitiesOverride() — new method that maps existing ModelCapability flags to SDK ModelCapabilitiesOverride:

      • Vision models (gemini-3-pro, etc.): Supports.Vision = true + image limits (PNG/JPEG/GIF/WebP, max 10 images, 20 MB)
      • Reasoning models (claude-opus, gpt-5, etc.): Supports.ReasoningEffort = true
      • Other models: returns null (server defaults apply)
    2. CopilotService.ChangeModelAsync() — now passes capabilities to SwitchToAsync instead of null

    Test Results

    • ✅ 3686 tests passed, 0 failed (includes 9 new tests for GetCapabilitiesOverride)
    • ✅ Integration test builds successfully
    • 🚀 Expert review and CI dispatched

    Warning

    ⚠️ Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • 192.0.2.1

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "192.0.2.1"

    See Network Configuration for more information.

    Generated by Agent Fix for issue #643 · ● 23.3M · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions