fix(core): stop an empty capability list from stripping image input (#13583)
`modelHasCapability` documents a missing or empty capability list as
carrying no signal, so each gate declares its own default. Two readers
bypassed it and read `capabilities` directly, where an empty list is not
nullish but `[].includes(x)` is false:
- the session runtime's `modelSupportsImages` metadata used
`capabilities?.includes("images") ?? true`, so the intended fail-open
never fired for an empty list and the file-read tool silently dropped
every image from the request;
- `toProviderModel` projected an empty list onto `false`, telling pickers
a model definitively lacks vision, attachments, and reasoning when
nothing had been declared.
Both now route through the shared helpers, which state their unspecified
default explicitly: `modelSupportsImageInput` fails open for a capability
gate, and `declaredCapability` preserves `undefined` for `ProviderModel`'s
tri-state booleans. A populated list stays authoritative in both.
A thinking config now short-circuits `supportsReasoning` instead of being
OR-ed with the capability read, so its absence no longer collapses the
tri-state to `false`.
Co-authored-by: Cline Agent <cline-agent@users.noreply.github.com> D
Dominic Cooney committed
f5370ad4cf0d880b5c668ada034acf180df99e44
Parent: a7a5750
Committed by GitHub <noreply@github.com>
on 8/31/2026, 9:58:38 PM