Allows switching between different agent modes (e.g., "ask", "architect", "code")
that affect system prompts, tool availability, and permission behaviors.
The mode must be one of the modes advertised in availableModes during session
creation or loading. Agents may also change modes autonomously and notify the
client via current_mode_update notifications.
This method can be called at any time during a session, whether the Agent is
idle or actively generating a response.
Sets the current mode for a session.
Allows switching between different agent modes (e.g., "ask", "architect", "code") that affect system prompts, tool availability, and permission behaviors.
The mode must be one of the modes advertised in
availableModesduring session creation or loading. Agents may also change modes autonomously and notify the client viacurrent_mode_updatenotifications.This method can be called at any time during a session, whether the Agent is idle or actively generating a response.
See protocol docs: Session Modes