LingYingNX sent MiniMax's Messages video block through the MiniMax plugin
(a plugin is always sent a translated request). readAnthropic had no case
for "video", so the block was left out: the reply was 200, the request
billed, and the model never saw the video. Chat's video_url and a Chat
file of a video were left out the same way (#4101).
A video is now a File part with a video/* media type (video_input.go):
- read from Messages' video block, Chat's video_url, a Chat file of a
video (nested, or the AI SDK's flat {type, data, mediaType}) and a
Responses input_file of one;
- built as a video block on Messages, video_url on Chat, inlineData on
Gemini's API (as before for Gemini);
- Responses has no shape for one: a latest-turn video translated there
is a 400 that says so (unportableVideo in translate).
A latest-turn video for a model whose list says it takes no video is a
400 before any upstream is asked; one of an earlier turn is told of in
words (Request.videoOff, set in buildFor). A routing group takes the
union of its members' Inputs/Outputs (buildGroupEntries, #2898), so
/v1/models lists video for group/... when a member takes it, and a video
goes only to members that take one, else to unknown ones, else a 400
naming the group.
Not changed: PDFs (Messages document, Responses input_file of a PDF, a
Chat file of a PDF) stay as #5452 says; input_audio stays with #4101.
Ran (mote, at this tree): gofmt -l (nothing), go vet ./...,
GOOS=windows go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=linux go build -tags nogui, GOOS=windows go build,
go test -tags nogui -timeout 45m ./internal/gateway ./internal/provider:
ok gateway (1072s), ok provider (132s).
Rebased on origin/main c4a9856df (3d8510f32 changed Gemini's inlineData,
which passes a video as it is): go vet ./internal/gateway and the video,
group and Gemini media tests again, ok.
New tests: TestPluginGetsTheVideoBlock (the reporter's body shape to a
plugin), TestVideoReachesEveryAPI (Chat video_url / file / AI SDK file /
Responses input_file to Messages, Messages to Chat, Chat to Gemini,
Messages to Responses = 400, Messages relayed), TestVideoForAModelThatTakesNone,
TestGroupVideoGoesToMembersThatTakeIt, TestGroupInputsAreItsMembers.
Broken by hand, each red: the Messages video parse case (4 tests), the
Messages video build, Chat's video build, Chat's video_url parse,
Responses' input_file parse, unportableVideo, the single-model gate, the
group filter, buildFor's videoOff, and unionKinds (provider and gateway
group tests).
Not tried: a real MiniMax account or any real vendor with a video; the
plugin side is plugins#985 (opencode-minimax-auth 0.2.6). The full
suite runs after the push.
Reported-by: LingYingNX