github / github/copilot-cli

MCP tool result image content blocks are not surfaced to the model

Ouverte
#4,536 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

area:mcp area:models
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

Describe the bug

When an MCP server returns an image content block in a tool result (per the MCP specification: content array item {type:"image", mimeType:"image/png", data:}), the image never reaches the model. Only the text blocks and structuredContent of the same tool result are delivered.

Verified from the agent side (Copilot CLI 1.0.80, Windows):

  1. The MCP server's wire format is spec-compliant. Capturing the raw stdio JSON-RPC response for a screenshot tool shows content[0] = text block and content[1] = a valid image block (mimeType image/png, correct base64 PNG payload).
    1. Across multiple calls (window screenshot, region screenshot), the image data never appeared in the model context; only the text metadata block arrived.
    1. Static inspection of app.js (1.0.80) shows image handling only in two paths: user-attachment sanitization (file_data / image_url / input_image) and the mcp-sampling converter for user-role messages. No conversion path exists for MCP tool-result image blocks, and tool results are assembled through the native session layer (session.mcp.apps.callTool).
      User-attached images (paste / drag-drop / @file) work fine, so the model and plan support vision. The gap is specific to images returned by MCP tools.
Affected version

1.0.80 (Windows 10.0.26200, PowerShell)

Steps to reproduce the behavior
  1. Configure any MCP server whose tool returns an image content block (e.g. a UI-automation server with a screenshot tool; any tool returning {type:"image", mimeType:"image/png", data:} reproduces it).
    1. In an interactive Copilot CLI session, ask the agent to call that tool and then describe what it sees in the image.
    1. Observe: the agent only receives the text blocks / structuredContent of the tool result. It reports the image metadata but cannot see the actual pixels, and often states the image content is unavailable.
Expected behavior

When the selected model supports vision, image content blocks inside MCP tool results should be passed to the model (like user-attached images), so agents can act on screenshots and other tool-generated images.

Additional context

This blocks a whole class of computer-use / UI-automation workflows: MCP servers that follow the spec and return screenshots as image blocks work in other agent CLIs that surface tool-result images, but not in Copilot CLI. Current workaround: agents must rely on structured reads only, or the user must manually attach the image.

Issue submitted by GLM-5.3 via rpacu MCP

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par suivre app.js, depuis la gestion existante des images des pièces jointes utilisateur et de MCP-sampling jusqu’aux résultats des outils assemblés via session.mcp.apps.callTool. Reproduisez le problème avec un outil de capture d’écran MCP qui renvoie un bloc d’image conforme à la spécification, puis vérifiez qu’un modèle capable de traiter les images reçoit l’image et peut la décrire, au lieu de recevoir uniquement ses métadonnées textuelles.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, shell
Domaine
ai, cli
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
62/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.