provider: Ark's plan models see images as the plans' docs say, not as /models says (XYenon)

XYenon on Discord (10-29): 10c85e1fe marked glm-5.3-flash,
deepseek-v4.1-flash and deepseek-v4.1-flash-economy text-only and left
kimi-k3 unmarked, so their images were described by another model
instead of sent to them. 10c85e1fe took arkPlanImages from the plans'
/api/coding/v3/models input_modalities, which #1216 (XYenon) showed
isn't the plans' list. Nothing read it at run time; the values were
copied into presets.go.

arkPlanImages now follows Ark's plan docs (Coding Plan 套餐概览
docs/82379/1925114 and Agent Plan 2366394, read 10-29):
- glm-5.3-flash "为原生多模态模型,支持图片输入", deepseek-v4.1-flash
  "原生具备多模态视觉理解能力", -economy "支持多模态输入": now true (were false).
- kimi-k3 "原生支持视觉理解", kimi-k2.8-preview "支持文本和图片输入",
  minimax-m3 "支持多模态视觉理解" (Coding Plan page): now true (were
  left to models.dev).
- The Doubao Seed models and kimi-k3.1-pro: the docs don't say either
  way; they keep true from 10c85e1fe (tongzhenbao's fix).
- deepseek-v4-flash and -pro stay false (DeepSeek's text-only V4; the
  docs give them no image input). ark-code-latest and glm-5.3 are left
  to models.dev as before.
Volcengine only: the map is read only by the two Ark plan regions.

Tests:
- TestArkPlanModelsSeeAsTheDocsSay (new): the six models the docs call
  image-taking are marked so by planModels.
- TestArkPlanModelThatSeesIsSentTheImage: glm-5.3-flash now gets the
  image itself; the text-only one described is deepseek-v4-pro.

Broken by hand: with presets.go at origin/main (10c85e1fe's map), both
are red: the new test names all six models, and glm-5.3-flash was sent
the describer's text.

Run on mote at this tree (base 172e65c80): gofmt -l clean; go vet
./internal/provider ./internal/gateway on darwin, linux (-tags nogui)
and windows ok; go test -count=1 -timeout 45m ./internal/provider
./internal/gateway ./internal/catalog: all ok (provider 98.6s, gateway 524.7s, catalog 0.7s).

Rebased onto d9431dd2e (ZCode mover min, GUI files): go test -count=1
./internal/provider ok again there (96.4s).

Not tried: a real image request to a Coding or Agent Plan model (no
Volcengine account here).
This commit is contained in:
yetone
2026-10-29 22:40:31 +08:00
parent d9431dd2ec
commit abd94e0b15
3 changed files with 51 additions and 16 deletions
+11 -7
View File
@@ -13,16 +13,16 @@ import (
// models.dev's resellers disagree on doubao-seed-2.1-pro, so magpie took
// it for text-only and had another model describe every image before Ark
// was asked. Ark's own list says it sees: its image goes to it as sent, and
// the describer isn't asked. A plan model Ark's list says is text-only
// (glm-5.3-flash) still has its image described.
// the describer isn't asked. A plan model that is text-only
// (deepseek-v4-pro) still has its image described.
func TestArkPlanModelThatSeesIsSentTheImage(t *testing.T) {
s, u := eyed(t)
up := strings.TrimSuffix(mustFind(t, "probe").Chat, "/v1")
if err := provider.Save(provider.Provider{ID: "volcengine", Name: "Volcengine Ark", Preset: "volcengine", Chat: up + "/api/coding/v3", Key: "ark-k",
Models: []string{"doubao-seed-2.1-pro", "glm-5.3-flash"}}); err != nil {
Models: []string{"doubao-seed-2.1-pro", "glm-5.3-flash", "deepseek-v4-pro"}}); err != nil {
t.Fatal(err)
}
for _, model := range []string{"doubao-seed-2.1-pro", "glm-5.3-flash"} {
for _, model := range []string{"doubao-seed-2.1-pro", "glm-5.3-flash", "deepseek-v4-pro"} {
body := `{"model":"volcengine/` + model + `","input":[{"role":"user","content":[{"type":"input_text","text":"read"},{"type":"input_image","image_url":"data:image/png;base64,aGVsbG8="}]}]}`
rec := httptest.NewRecorder()
s.Handler().ServeHTTP(rec, httptest.NewRequest("POST", "/v1/responses", strings.NewReader(body)))
@@ -33,10 +33,14 @@ func TestArkPlanModelThatSeesIsSentTheImage(t *testing.T) {
if got := u.sent("doubao-seed-2.1-pro"); len(got) != 1 || !strings.Contains(got[0], "aGVsbG8=") || strings.Contains(got[0], "HELLO") {
t.Fatalf("doubao-seed-2.1-pro, which Ark says sees, was sent %v", got)
}
if got := u.sent("glm-5.3-flash"); len(got) != 1 || strings.Contains(got[0], "aGVsbG8=") || !strings.Contains(got[0], "HELLO") {
t.Fatalf("glm-5.3-flash, which Ark says is text-only, was sent %v", got)
// XYenon: the plan docs say glm-5.3-flash takes images.
if got := u.sent("glm-5.3-flash"); len(got) != 1 || !strings.Contains(got[0], "aGVsbG8=") || strings.Contains(got[0], "HELLO") {
t.Fatalf("glm-5.3-flash, which Ark's docs say sees, was sent %v", got)
}
if got := u.sent("deepseek-v4-pro"); len(got) != 1 || strings.Contains(got[0], "aGVsbG8=") || !strings.Contains(got[0], "HELLO") {
t.Fatalf("deepseek-v4-pro, which is text-only, was sent %v", got)
}
if n := len(u.sent("eye")); n != 1 {
t.Fatalf("the describer was asked %d times, want once (for glm-5.3-flash alone)", n)
t.Fatalf("the describer was asked %d times, want once (for deepseek-v4-pro alone)", n)
}
}
+16 -9
View File
@@ -133,17 +133,24 @@ var arkPlanModels = []string{"ark-code-latest", "doubao-seed-evolving", "doubao-
"doubao-seed-2.0-mini", "minimax-m3", "glm-5.3", "glm-5.3-flash", "deepseek-v4.1-flash", "deepseek-v4.1-flash-economy", "deepseek-v4-flash", "deepseek-v4-pro",
"kimi-k2.8-preview", "kimi-k3", "kimi-k3.1-pro"}
// arkPlanImages are which of arkPlanModels take images, as Ark's own
// /api/coding/v3/models says of the dated model each one is (its
// input_modalities, 10-29): models.dev's resellers disagree on
// doubao-seed-2.1-pro and say nothing of 2.1-lite, so magpie took them for
// text-only and had every image of theirs described by another model
// first, a minute or more before the first token (tongzhenbao on X). The
// ones Ark's list doesn't name (ark-code-latest, glm-5.3, kimi-k3,
// kimi-k2.8-preview, minimax-m3) are left to models.dev.
// arkPlanImages are which of arkPlanModels take images, as Ark's plan
// docs say (Coding Plan 套餐概览 docs/82379/1925114, Agent Plan 2366394,
// read 10-29), never the plans' /models: its input_modalities aren't the
// plans' models (#1216), and 10c85e1fe took them from it and marked
// glm-5.3-flash and deepseek-v4.1-flash(-economy) text-only, so their
// images went to another model to be described (XYenon). The docs say
// glm-5.3-flash "为原生多模态模型,支持图片输入", deepseek-v4.1-flash "原生
// 具备多模态视觉理解能力", -economy "支持多模态输入", kimi-k3 "原生支持视觉
// 理解", kimi-k2.8-preview "支持文本和图片输入" and minimax-m3 "支持多模态
// 视觉理解". The Doubao Seed models and kimi-k3.1-pro aren't described
// either way there and keep what tongzhenbao's fix gave them (they see);
// deepseek-v4-flash and -pro are DeepSeek's text-only V4, which V4.1 Flash
// added vision to. ark-code-latest and glm-5.3 are left to models.dev.
var arkPlanImages = map[string]bool{
"glm-5.3-flash": true, "deepseek-v4.1-flash": true, "deepseek-v4.1-flash-economy": true,
"kimi-k3": true, "kimi-k2.8-preview": true, "minimax-m3": true,
"doubao-seed-evolving": true, "doubao-seed-2.1-pro": true, "doubao-seed-2.1-lite": true, "doubao-seed-2.0-mini": true, "kimi-k3.1-pro": true,
"glm-5.3-flash": false, "deepseek-v4.1-flash": false, "deepseek-v4.1-flash-economy": false, "deepseek-v4-flash": false, "deepseek-v4-pro": false,
"deepseek-v4-flash": false, "deepseek-v4-pro": false,
}
// alibabaPlanModels are the text models of Alibaba's Token Plan, the same
+24
View File
@@ -223,3 +223,27 @@ func TestArkPlanImagesAreThePlans(t *testing.T) {
}
}
}
// XYenon: Ark's plan docs say glm-5.3-flash, deepseek-v4.1-flash,
// -economy and kimi-k3 take images, so each is sent the image itself, not
// marked text-only from the plans' /models (#1216: not the plans' list).
func TestArkPlanModelsSeeAsTheDocsSay(t *testing.T) {
p, err := FromPreset("volcengine")
if err != nil {
t.Fatal(err)
}
ms := map[string]catalog.Model{}
for _, m := range p.planModels(nil) {
ms[m.ID] = m
}
for _, id := range []string{"glm-5.3-flash", "deepseek-v4.1-flash", "deepseek-v4.1-flash-economy", "kimi-k3", "kimi-k2.8-preview", "minimax-m3"} {
m, ok := ms[id]
if !ok {
t.Errorf("%s isn't a plan model", id)
continue
}
if m.ImageInput == nil || !*m.ImageInput || !m.Images {
t.Errorf("%s: the docs say it takes images, marked %v (%v)", id, m.Images, m.ImageInput)
}
}
}