Admit image attachments on text-only model routes (the dispatch layer already degrades them) #5848
Replies: 1 comment 1 reply
|
Good write-up — both anchors check out on master Confirmation:
Why the admission gate is the wrong layer (three independent reasons):
On the proposal itself: admit-and-degrade is directionally right, but I'd keep some user-visible signal for genuinely text-only models. The projection silently replaces pixels with a text placeholder — a user who attached a diagram believing the model saw it gets an invisible loss. The model dropdown already carries per-model modality where the catalog/route metadata exposes it (the #5837/#5840 surface), so a non-fatal send-time warning ("this model is text-only; the image will be degraded to a text placeholder") preserves the intent of today's hard block without the dead-end. Admission + durable-log entry + running hooks is strictly more information-preserving than a hard reject, and genuinely invalid attachments can still surface as the attachment-side failure you describe. Suggested shape: relax the gate to admit + warn, keep the dispatch projection as the safety net, and fix the declaration axis in parallel so image-capable routes stop being declared text-only. The core hunk is small ( |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When the session model is text-only, attaching an image and sending the prompt is rejected at admission (
session/attachment-invalid/MODEL_DOES_NOT_SUPPORT_IMAGES, thrown by the prompt admission inpackages/api/session-controller/src/commands.ts). The message never enters the durable session log, so no turn starts — and per-turn extension points (prompt-context providers, vision-relay plugins) never run. The only user workarounds are switching models, or saving the image to disk and asking the agent to read it by file path.Why admission can safely allow it
The LLM core already handles exactly this case at dispatch time —
packages/llm/llm/src/index.tsprojects image blocks to text placeholders whenever the resolved model'sinputModalitieslackimage:So the admission gate is a UX hard-block sitting on top of a dispatch pipeline that is already safe for text-only routes.
Proposal
Admit image-bearing prompts regardless of the model's image support:
read_imagetool's strict vision-model gate remains unchanged.Local validation
We have been running this change locally since 2026-09-01: remove the admission block in
commands.tsand updatesession-models.host.spec.tsto expect admission. Ond347e70390(0.1.3-alpha.1),vitest run packages/api/session-controller/tests/session-models.host.spec.tspasses 14/14. It enables a vision-relay plugin pattern in our setup: a plugin describes pasted images through a vision model and injects the descriptions as prompt context, so text-only sessions keep full image workflows.Happy to share the full diff here if useful (CONTRIBUTING notes external PRs aren't accepted at the moment, so this is a discussion, not a PR).
Environment: DSH 0.1.3-alpha.1 (
d347e70390), Windows, web GUI.All reactions