Skip to content

feat: detect image input support in test-connection endpoint - #496

Open
Gucc111 wants to merge 1 commit into
OpenBMB:mainfrom
Gucc111:feat/test-connection-image-probe
Open

feat: detect image input support in test-connection endpoint#496
Gucc111 wants to merge 1 commit into
OpenBMB:mainfrom
Gucc111:feat/test-connection-image-probe

Conversation

@Gucc111

@Gucc111 Gucc111 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add image-support detection to POST /api/config/test-connection: after the connectivity test passes, the endpoint determines whether the model accepts image input.
  • Two-tier strategy: first check the built-in provider catalog (covers exact match, aliases, cross-provider lookup, and vendor-prefix stripping for proxy providers like OpenRouter); if no catalog entry is found, send a live probe with a minimal 1x1 PNG to the provider.
  • Response now includes supportsImage (true / false / null) and imageCheckSource ("catalog" or "probe") when connectivity succeeds. Failure responses are unchanged.

Test plan

  • Catalog hit with vision model returns supportsImage: true, imageCheckSource: 'catalog'
  • Catalog hit with text-only model returns supportsImage: false, imageCheckSource: 'catalog'
  • Cross-provider catalog lookup (e.g. OpenRouter → Anthropic) returns correct result
  • Catalog miss + probe success returns supportsImage: true, imageCheckSource: 'probe'
  • Catalog miss + probe 4xx returns supportsImage: false, imageCheckSource: 'probe'
  • Catalog miss + probe timeout returns supportsImage: null, imageCheckSource: 'probe'
  • Connectivity failure does not include supportsImage field
  • All 32 existing + new tests pass

Made with Cursor

Add image support detection to POST /api/config/test-connection.
After the connectivity test passes, the endpoint now checks whether
the model accepts image input via two strategies:

1. Catalog fast-path: look up the model in the built-in provider
   catalog (supports exact, alias, cross-provider, and vendor-prefix
   stripping) and read the multimodal.input metadata directly.

2. Live probe fallback: for models not in the catalog, send a minimal
   1x1 PNG image with a short prompt to the provider and interpret
   the response (success → true, 4xx → false, timeout → null).

The response now includes `supportsImage` (true/false/null) and
`imageCheckSource` ("catalog" or "probe") when the connectivity
test succeeds. Failure responses are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Gucc111
Gucc111 requested a review from mssssss123 August 17, 2026 11:07
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