OpenCode 2 reads the shared ~/.config/opencode/opencode.json and drops
the V1 model field `attachment` with a "configuration normalization
diagnostic ... omitted unsupported legacy setting" WARN per model on
every load. magpie wrote attachment: true on each image model. Nothing in
OpenCode 1.18.34 reads it for behaviour: image input comes from
`modalities`, which magpie still writes and OpenCode 2 normalizes
silently. A rewrite takes the models map whole, so an old attachment key
goes too.
`reasoning` stays: OpenCode 1 reads it for the effort variants (#725),
so OpenCode 2 still warns on it for models marked reasoning.
Run:
- TestOpenCode image-input tests seed an old attachment key and check it
is gone; red without the fix ("still has attachment"), green with it.
- Real OpenCode 2.0.25 (`opencode models --standalone --print-logs
--log-level warn`) in a sandbox HOME on the written config: WARN for
attachment before, none after.
- OpenCode 1.18.34 source read: no reader of capabilities.attachment for
behaviour.
- gofmt -l; go vet ./... darwin, GOOS=linux -tags nogui, GOOS=windows.
- go test ./... : all green except internal/provider, which hit the
10-minute timeout at load ~274; alone with -timeout 25m it passed (341s).
Not tried: sending an image prompt through OpenCode 2.
magpie's models.yml entries had no input or maxTokens, so omp fell back to a fuzzy-matched bundled model or text-only / 16384. Write input from the model's image answer (omitted when unknown) and maxTokens from its output limit; carry ImageInput through magpieModels.
A model's image input is taken from models.dev and the provider's own list, and a group's from its members: only a model known to be text-only is refused an image — one whose support is unknown still gets it, and Codex, OpenCode and Pi are told which models take images. An image the user attaches for a text-only model answers 400 in the client's own format before the upstream is asked; an image earlier in the chat, or one a tool returned (Claude Code's Read, Codex's view_image, a Chat tool message), becomes a short text note, so a chat that met a picture carries on after a switch to a text-only model. Thanks @herrkaefer.