Files
weichenandCursor cfde38de31 Send current-turn images and keep vision fallbacks capable
Why: Uploaded images never reached the model, so a text-only chat model could be asked to read a picture it cannot see.

Evidence: go test ./internal/... passed locally before this commit. Image-link rejection is covered by vision package tests.

Impact: Current-turn attachments and fetched image links become image input. History keeps a text placeholder. Image turns swap to the configured vision model when the chat model is not in the capable list, and fallbacks are filtered the same way.

Refs: Agent-System-Dev feature/four-model-vision
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:51:17 +00:00

19 lines
768 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Package vision 负责「这一轮要不要把图发给模型」:能力清单、图片字节预算、
// 以及用户粘贴的图片链接的受控下载。模型名和端点仍由 runtime 的路由解析。
package vision
// 默认可看图清单与兜底模型。网关路由变化时改设置 models.vision.capable,
// 不必改代码。空设置回落到这里。
const (
DefaultVisionModel = "qwen3.8-flash"
DefaultVisionCapable = "deepseek-v4.1-flash,qwen3.8-flash,ZHIPU/GLM-5.3-FlashX,ZHIPU/GLM-5.3-Flash"
)
// 单图与单轮上限。按网关实测的小图请求体留出余量:base64 约膨胀 4/3,
// 8MB 原图约 11MB 请求体,单轮合计 20MB 原图。
const (
MaxImageBytes = 8 << 20
MaxImages = 8
MaxTotalBytes = 20 << 20
)