Skip to content

feat(ask-code): send attached images to an image-capable MiniMax model - #262

Open
octo-patch wants to merge 1 commit into
johannesjo:mainfrom
octo-patch:octo/20260817-input-capability-recvs9d7W3SH0j
Open

feat(ask-code): send attached images to an image-capable MiniMax model#262
octo-patch wants to merge 1 commit into
johannesjo:mainfrom
octo-patch:octo/20260817-input-capability-recvs9d7W3SH0j

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Reason: The inline code Q&A already resolves pasted images to temp file paths, but the MiniMax provider could only send a text prompt, so an attached image never reached a model that accepts image input.

What changed

  • electron/ipc/ask-code-minimax.ts — a request can now carry imagePaths. When images are attached, the user message is sent as content parts (a text part plus one image_url data URL per image) instead of a plain string, and the request is routed to a model whose catalog input modalities include images (MiniMax-M3, which accepts text, image and video input). MiniMax-M2.7 is text-only and stays the default for text questions, so text-only requests send exactly the same payload as before. Image input is validated and capped separately from the 50,000-character prompt limit, since the bytes never count against it: at most 4 images per question, 10 MB each, .png / .jpg / .jpeg / .webp / .gif. Unsupported or excessive input is rejected before a request slot is taken, and an unreadable file is reported on the response channel.
  • electron/ipc/ask-code.ts, electron/ipc/register.ts — forward the new imagePaths argument and validate it, running every entry through the existing absolute-path check. The other Q&A backend is unchanged and still receives a text prompt only.
  • src/components/InlineInput.tsx — pasting an image into the inline Ask input attaches it, reusing the existing resolve_clipboard_paste handler that the terminal already uses, so no new IPC channel is added. The affordance is only active in Ask mode while the MiniMax provider is selected, and a small chip shows the attachment and clears it.
  • src/components/ReviewProvider.tsx, src/components/ScrollingDiffView.tsx, src/components/PlanViewerDialog.tsx, src/components/AskCodeCard.tsx — thread the attached paths from the inline input through the question to the request. Both Ask surfaces share the same input, so both gain the capability.

New tests in electron/ipc/ask-code-minimax.test.ts cover the model modality lookup, the unchanged text-only payload, image parts sent as data URLs to the image-capable model, a rejected image type, the per-question image cap, and an unreadable image surfacing as an error without a request being sent.

Checks

  • npx vitest run — 115 files passed, 1873 tests passed, 22 skipped
  • npx vitest run --config vitest.client.config.ts — 2 files passed, 9 tests passed
  • npx tsc --noEmit and npx tsc -p electron/tsconfig.json — clean
  • npx eslint . --max-warnings 0 — clean
  • npx prettier --check . — clean
  • npm run lint:arch — no dependency violations
  • npm run lint:dead — clean

The inline code Q&A resolved pasted images to temp file paths, but the
MiniMax backend only ever sent a text prompt, so the image was dropped.

Requests now carry image paths, the user message becomes text plus
image_url content parts when images are attached, and such requests go to
a model whose catalog input modalities include images. Text-only requests
keep the previous payload and model. Image input is validated and capped
separately from the prompt length limit.
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.

1 participant