fix(zoo-gateway): enable image attach when model supports vision#897
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe Vercel AI Gateway model schema now accepts capability tags, and image support detection prefers the ChangesGateway capability detection
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
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
/modelstags(including vision`) instead of only a hardcoded allowlist that drifts out of dateWhy
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(fromsrc/)tags→ allowlisted vision models still enable attachSummary by CodeRabbit
New Features
Bug Fixes