Skip to content

Connect generic provider image input to Responses-to-Chat pipeline - #86

Open
octo-patch wants to merge 1 commit into
7as0nch:mainfrom
octo-patch:octo/20260728-input-capability-recvpvu5EMY811
Open

Connect generic provider image input to Responses-to-Chat pipeline#86
octo-patch wants to merge 1 commit into
7as0nch:mainfrom
octo-patch:octo/20260728-input-capability-recvpvu5EMY811

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Connect MiniMax image input to the existing Responses-to-Chat image pipeline; generic supportsImages metadata was UI-only, so MiniMax images were stripped.

Problem

Generic OpenAI-compatible providers (e.g. MiniMax) declare supportsImages per model in providers.json, but reqToChat only consulted the hardcoded MiMo-only modelSupportsImages() check when deciding whether to keep input_image parts. As a result, image parts were stripped for any non-MiMo model id — even when the upstream actually accepts image input — making the declared supportsImages metadata UI-only.

Change

  • src/translate/reqToChat.ts: add supportsImages?: boolean to ReqToChatOpts. When provided, it overrides the hardcoded modelSupportsImages(effectiveModel) check; otherwise behavior is unchanged (MiMo keeps its existing routing).
  • src/providers/generic.ts: in preprocessResponses, look up the resolved upstream model's supportsImages metadata from the declared model catalog and forward it to reqToChat. Open-catalog providers (no declared models) and unknown ids keep falling back to the hardcoded check.

Checks

  • npx tsc -p . — typecheck passes.
  • npx vitest run — full suite (50 files, 681 tests) passes, including new createGenericProvider — supportsImages metadata (input-capability) tests covering image forwarding when supportsImages: true, stripping when omitted, and fallback for open-catalog providers.

Generic OpenAI-compatible providers (e.g. MiniMax) declare supportsImages
per model in providers.json, but reqToChat only consulted the hardcoded
MiMo-only modelSupportsImages() check, so image parts were stripped for any
non-MiMo model id even when the upstream actually accepts image input.

Forward the declared model's supportsImages metadata through ReqToChatOpts so
generic providers keep image parts for vision-capable models.
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