{"version":"2.1.251","anchor":"model-switches-can-be-blocked-or-held-for-confirmation-by-a-","canonical_anchor":"model-switches-can-be-blocked-or-held-for-confirmation-by-a-","heading":"\/model switches can be blocked or held for confirmation by a hook","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251\/e\/model-switches-can-be-blocked-or-held-for-confirmation-by-a-","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251","markdown":"### \/model switches can be blocked or held for confirmation by a hook\n\nA PreModelSwitch hook can block or hold your \/model change for confirmation.\n\n**What**\n\nRunning `\/model` with a model name now consults any registered model-switch hooks before the model changes. A hook can block the switch outright, in which case you see \"model switch blocked by a PreModelSwitch hook\" and are told to run `\/model` to confirm, or it can answer \"ask\", which leaves the model unchanged and directs you to `\/model` interactively. Hooks can also attach their own messages to the confirmation, so a switch that needs a second look explains why instead of failing silently.\n\n**Details**\n\n- Only engaged when model-switch hooks are registered by the caller; with none registered, switching behaves exactly as before.\n- A hook answering \"ask\" changes nothing and defers to the interactive `\/model` picker.\n- The check on whether a model is available now gives up and reports \"Couldn't confirm model '\" rather than hanging indefinitely when it stalls.\n\n**Evidence**\n\n`Couldn't confirm model '`, `model switch blocked by a PreModelSwitch hook`\n\n- Area: Hooks\n- Names: `\/model`, `PreModelSwitch`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 4\/5"}