Say when /model does not recognise the id (#831) - #836
Merged
Conversation
`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
force-pushed
the
fix/831-unrecognised-model-note
branch
from
September 2, 2026 08:27
9a882d7 to
1b45de0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #831. Sequel to #825/#826.
What was wrong
resolve_model_switchends in a deliberate permissive fallthrough: an id thatmatches no configured alias and no known model family returns
Keep, which iswhat lets
/model claude-opus-6work 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
Keepis also what/model offgets, and the report is a real slip:offis a valid argument to both
/effort offand/agent off, and there is no/modelequivalent of "go back", so reaching for it is natural. It reportssuccess and leaves
session.model = "off", with nothing said until the nextrequest 400s.
What this does
Keeps applying it, and says so. The unrecognised case now returns its own
ModelSwitch::KeepUnrecognized, carried through toModelRoute::Active { model, recognized }, and/modelappends one clause:The clause never fires on the common paths — a configured alias, an exact pin,
the gateway-dialect rule, or an id whose family
model_familyknows — so inpractice 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-5silently, which is the case most worth catching.Same clause on the ACP
/modelpath, which shares the routing decision.