Skip to content
Prev Previous commit
Next Next commit
fix(provider): use honest metadata instead of misleading 'Attached' l…
…abel for unsupported parts

Replace 'Attached' with 'User provided' and add a suffix explaining the
file is still available via tools and filesystem, even if this model
cannot process it directly. This prevents the LLM from hallucinating
that it has direct access to the file content while still informing it
the file exists and can be routed to vision-capable tools.
  • Loading branch information
andrea-tomassi committed May 26, 2026
commit 2e52165d473ff76c7ae269d4a4aeafbafdbc99db
2 changes: 1 addition & 1 deletion packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function unsupportedParts(msgs: ModelMessage[], model: Provider.Model): ModelMes

return {
type: "text" as const,
text: `[Attached ${modality}${filename ? `: "${filename}" (${mime})` : ` (${mime})`}]`,
text: `[User provided ${modality}${filename ? `: "${filename}" (${mime})` : ` (${mime})`}. Direct processing unsupported — available via tools and filesystem.]`,
}
})

Expand Down
Loading