MoonshotAI / MoonshotAI/kimi-code

Pasted images fail on text-only models — should offload to file + MCP path

Open
#905 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Problem

When a user pastes an image (Cmd-V) while using a text-only model (GLM-5.2, DeepSeek, Qwen, etc.), kimi-code sends the image as image_url content directly to the model API. The model rejects it with:

Error: Current model does not support image input.

The paste fails entirely — the image never reaches the conversation, and there is no fallback path.

Expected behavior

When the active model lacks image_in capability, kimi-code should offload the pasted image to a temp file and insert a text reference (file path) into the conversation instead of rejecting it outright. The agent can then process the image through a vision MCP server (e.g. @z_ai/mcp-server, @playwright/mcp) if one is configured.

This matters because many users pair a text-only coding model with a separate vision MCP server. The current behavior makes paste-to-chat unusable for this setup.

Suggested flow

  1. User pastes image (Cmd-V)
  2. kimi-code checks if the active model supports image_in (from the model capabilities in config.toml)
  3. If yes: send as image_url (current behavior)
  4. If no: save to /tmp/kilo-shots/pasted-{timestamp}.png, insert the file path as text in the input box (or as a system note), and let the agent decide how to process it (ReadMediaFile, vision MCP tool, etc.)

Current workaround

I run a clipboard watcher daemon that intercepts images, saves them to /tmp/kilo-shots/, and replaces the clipboard with the file path text. This works but is external to kimi-code — the fix should be native.

Environment

  • kimi-code v0.18.0
  • macOS (but the issue is cross-platform)
  • Model: zai-coding-plan/glm-5.2 (text-only, capabilities: ["thinking", "tool_use"] — no image_in)
  • Vision MCP: @z_ai/mcp-server (provides analyze_image, extract_text_from_screenshot, etc.)

Config

[models."zai-coding-plan/glm-5.2"]
provider = "zai-coding-plan"
model = "glm-5.2"
max_context_size = 1000000
max_output_size = 131072
capabilities = [ "thinking", "tool_use" ]  # no image_in
display_name = "GLM-5.2"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Cmd-V paste flow and the model capability settings shown in config.toml, especially the absence of image_in. Trace how image_url content is created for text-only models and how the file path should reach the conversation or a vision MCP tool. Done means image-capable models retain the current behavior, while text-only models save the paste and provide its path without rejecting the conversation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.