Skip to content

fix(zoo-gateway): enable image attach when model supports vision#897

Merged
edelauna merged 3 commits into
mainfrom
fix/zoo-gateway-vision-capabilities
Jul 15, 2026
Merged

fix(zoo-gateway): enable image attach when model supports vision#897
edelauna merged 3 commits into
mainfrom
fix/zoo-gateway-vision-capabilities

Conversation

@JamesRobert20

@JamesRobert20 JamesRobert20 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Gate image attachment on whether the selected Zoo Gateway / Vercel AI Gateway model actually supports vision
  • Read that capability from live /models tags (including vision`) instead of only a hardcoded allowlist that drifts out of date
  • Keep the allowlist as a fallback when tags are missing from older catalog responses

Why

Image attach in chat is controlled by supportsImages. For Zoo Gateway (and Vercel AI Gateway), that flag came from a static model-ID allowlist, so vision-capable models that were not listed still had image input disabled. This makes capability detection follow the models API.

Test plan

  • pnpm exec vitest run api/providers/fetchers/__tests__/vercel-ai-gateway.spec.ts api/providers/fetchers/__tests__/zoo-gateway.spec.ts (from src/)
  • Zoo Gateway signed in + vision-tagged model → image attach enabled
  • Non-vision tagged model → image attach disabled
  • Catalog response without tags → allowlisted vision models still enable attach

Summary by CodeRabbit

  • New Features

    • Added support for additional Anthropic and OpenAI models through the Vercel AI Gateway.
    • Improved image-capability detection using live model tags, with fallback support for existing model capabilities.
    • Added vision capability detection for tagged Zoo Gateway models.
  • Bug Fixes

    • Improved accuracy when identifying models that support image inputs, including models without capability tags.

Prefer models-API vision tags over the stale hardcoded allowlist so Zoo Gateway (and Vercel AI Gateway) correctly enable image attachment for models like Claude Sonnet 4.5.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 966e9626-8274-4638-a564-de0049f550be

📥 Commits

Reviewing files that changed from the base of the PR and between 1d7703c and 42c4b8a.

📒 Files selected for processing (1)
  • src/api/providers/fetchers/vercel-ai-gateway.ts
💤 Files with no reviewable changes (1)
  • src/api/providers/fetchers/vercel-ai-gateway.ts

📝 Walkthrough

Walkthrough

The Vercel AI Gateway model schema now accepts capability tags, and image support detection prefers the vision tag before using static allowlists. Additional Anthropic and OpenAI vision-capable models were added, with tests covering tagged and fallback behavior.

Changes

Gateway capability detection

Layer / File(s) Summary
Vision contract and allowlist expansion
packages/types/src/providers/vercel-ai-gateway.ts, src/api/providers/fetchers/vercel-ai-gateway.ts
Vercel AI Gateway model entries now support optional tags, and the vision-and-tools allowlist includes additional Anthropic and OpenAI models.
Tag-based image support parsing
src/api/providers/fetchers/vercel-ai-gateway.ts, src/api/providers/fetchers/__tests__/vercel-ai-gateway.spec.ts, src/api/providers/fetchers/__tests__/zoo-gateway.spec.ts
Image support is derived from vision tags when available and falls back to static allowlists otherwise; Vercel and Zoo Gateway tests cover the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VercelAIGateway
  participant ModelSchema
  participant ModelParser
  participant VisionAllowlists
  VercelAIGateway->>ModelSchema: Provide model data with optional tags
  ModelSchema->>ModelParser: Pass validated model
  ModelParser->>ModelParser: Check tags for vision
  ModelParser->>VisionAllowlists: Check fallback when tags are absent
  VisionAllowlists-->>ModelParser: Return vision capability result
Loading

Possibly related PRs

Suggested labels: awaiting-review

Suggested reviewers: taltas, navedmerchant, hannesrudolph, edelauna

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, rationale, and tests, but it omits the required linked GitHub issue and several template sections. Add a Related GitHub Issue section with Closes: #, and complete the checklist plus any required documentation, screenshots, and contact fields.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: enabling image attach for vision-capable Zoo Gateway models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/zoo-gateway-vision-capabilities

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JamesRobert20 JamesRobert20 changed the title fix(zoo-gateway): enable image attach from live vision model tags fix(zoo-gateway): enable image attach when model supports vision Jul 15, 2026
CI does not flag no-var on the ambient global declaration, so the disable became an unused-directive warning.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 15, 2026
@edelauna edelauna added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit e07d776 Jul 15, 2026
14 checks passed
@edelauna edelauna deleted the fix/zoo-gateway-vision-capabilities branch July 15, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants