SDK-driven model switches now go through hook approval and can affect auto/plan permission modes
When the SDK (the programmatic interface used to drive Claude Code) triggers a model switch, the handler for it now validates the target model, can short-circuit early via a bridge-print check, and routes the change through a hook-approval step, unless the session has no hooks pending, before applying it. Hooks are user-configured scripts that can approve, block, or modify actions. After the switch, the handler adjusts tool-permission context for sessions in 'auto' or 'plan' permission mode: it can deny the switch (recorded as auto_gate_denied) or update plan-mode context as appropriate.
This means a model switch requested via the SDK can now be intercepted by hooks and can be denied or adjusted based on the session's current permission mode, rather than always applying immediately.