Skip to content

Add Copilot-Vision-Request header for image inputs in Responses path #20

@HXYerror

Description

@HXYerror

Part of #1. Depends on #3.

Goal

When a Responses request contains an input_image content part, the upstream Copilot proxy expects the Copilot-Vision-Request: true header (mirrors what VS Code Copilot Chat sends). Without it, vision requests on multimodal models can be rejected or silently degraded.

Current state

src/services/copilot/create-chat-completions.ts does not set Copilot-Vision-Request today. The Responses service client created in #3 should set it conditionally.

Tasks

  • In the Responses service client (Add upstream Responses API service client #3), add a _hasVisionInput(input) helper that recursively walks input items / message content parts looking for type: 'input_image' (cap depth at, say, 8 to avoid pathological inputs)
  • If found, set request header Copilot-Vision-Request: true
  • Apply the same logic to the existing chat-completions client for image_url content parts (small follow-up; verify against what VS Code actually sends)

Acceptance criteria

  • Manual test with a Responses request containing input_image against a vision-capable model returns a vision-aware reply
  • Manual test with a text-only request does not set the header (verify via --verbose)

File pointers

  • litellm reference: litellm/llms/github_copilot/responses/transformation.py_has_vision_input

Metadata

Metadata

Assignees

No one assigned

    Labels

    responses-apiOpenAI /v1/responses API support

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions