Skip to content

Say when /model does not recognise the id (#831) - #836

Merged
yogthos merged 1 commit into
mainfrom
fix/831-unrecognised-model-note
Sep 2, 2026
Merged

Say when /model does not recognise the id (#831)#836
yogthos merged 1 commit into
mainfrom
fix/831-unrecognised-model-note

Conversation

@yogthos

@yogthos yogthos commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #831. Sequel to #825/#826.

What was wrong

resolve_model_switch ends in a deliberate permissive fallthrough: an id that
matches no configured alias and no known model family returns Keep, which is
what lets /model claude-opus-6 work on release day, before dirge knows the id.
#826 narrowed the trap to genuinely unknown strings rather than closing it, on
purpose — and that is worth keeping.

But Keep is also what /model off gets, and the report is a real slip: off
is a valid argument to both /effort off and /agent off, and there is no
/model equivalent of "go back", so reaching for it is natural. It reports
success and leaves session.model = "off", with nothing said until the next
request 400s.

What this does

Keeps applying it, and says so. The unrecognised case now returns its own
ModelSwitch::KeepUnrecognized, carried through to ModelRoute::Active { model, recognized }, and /model appends one clause:

switched to model: off  (unrecognised — your provider may not serve it)

The clause never fires on the common paths — a configured alias, an exact pin,
the gateway-dialect rule, or an id whose family model_family knows — so in
practice it fires on typos and on genuinely new models, where "dirge does not
recognise this" is simply true.

On what the note claims. dirge cannot know whether an id is valid; only the
provider can. It knows whether it recognises it. Those come apart for a
new-but-valid id, so the clause asserts recognition and leaves the consequence
conditional ("may not serve it") rather than predicting a failure.

The rejected alternative from the issue — suppressing the note when the id
"looks like" a model — is not implemented, for the reasons given there: it would
pass claude-opuss-5 silently, which is the case most worth catching.

Same clause on the ACP /model path, which shares the routing decision.

`resolve_model_switch` ends in a deliberate permissive fallthrough: an id
matching no configured alias and no known model family returns `Keep`,
which is what lets `/model claude-opus-6` work on release day. #826
narrowed the trap to genuinely unknown strings rather than closing it, on
purpose, and that stays.

But `Keep` is also what `/model off` gets, and reaching for `off` is a
natural slip — it is a valid argument to both `/effort off` and `/agent
off`, and `/model` has no "go back". It reported success and left
`session.model = "off"`, with nothing said until the next request 400s.

Keep applying it, and say so. The unrecognised case now returns its own
`ModelSwitch::KeepUnrecognized`, carried through to `ModelRoute::Active {
model, recognized }`, and `/model` appends one clause:

    switched to model: off  (unrecognised — your provider may not serve it)

The clause never fires on a configured alias, an exact pin, the
gateway-dialect rule, or an id whose family `model_family` knows, so in
practice it fires on typos and on genuinely new models. It asserts
RECOGNITION, not validity — only the provider knows whether an id is
servable, and the two come apart for a new-but-valid id — so the
consequence stays conditional. Same clause on the ACP `/model` path.
@yogthos
yogthos force-pushed the fix/831-unrecognised-model-note branch from 9a882d7 to 1b45de0 Compare September 2, 2026 08:27
@yogthos
yogthos merged commit c01eb57 into main Sep 2, 2026
15 checks passed
@yogthos
yogthos deleted the fix/831-unrecognised-model-note branch September 2, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/model with an unclassifiable id applies silently — warn instead (sequel to #825)

1 participant