{"version":"2.1.251","anchor":"the-model-menu-and-sdk-flag-changes-wait-on-premodelswitch-h","canonical_anchor":"the-model-menu-and-sdk-flag-changes-wait-on-premodelswitch-h","heading":"The \/model menu and SDK flag changes wait on PreModelSwitch hooks","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251\/e\/the-model-menu-and-sdk-flag-changes-wait-on-premodelswitch-h","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251","markdown":"### The \/model menu and SDK flag changes wait on PreModelSwitch hooks\n\nModel and effort changes from the picker now run hooks first and can be cancelled.\n\n**What**\n\nChanging model or effort level from the `\/model` menu now runs hooks first, showing a \"Running PreModelSwitch hooks\u2026\" spinner. A `block` decision cancels the switch and shows the hook's reason; `ask` sends you to the confirmation dialog with that reason as the prompt. Any system messages the hook returns are appended to the resulting notice.\n\n**Details**\n\n- The same pass runs when an SDK client changes model or agent through `apply_flag_settings`; anything other than `proceed` blocks the switch and reports back over the control channel.\n- If the session's model changes while the hooks are still running, the request is rejected with \"agent switch not applied: the session's model changed while PreModelSwitch hooks ran; send the request again\".\n- Only has an effect if a PreModelSwitch hook is configured.\n\n**Evidence**\n\n`Running PreModelSwitch hooks\u2026`, `agent switch not applied: the session's model changed while PreModelSwitch hooks ran; send the request again`\n\n- Area: Hooks\n- Names: `\/model`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 3\/5"}