{"version":"2.1.319","anchor":"set-permission-mode-serializes-through-a-queue-and-re-valida","canonical_anchor":"set-permission-mode-serializes-through-a-queue-and-re-valida","heading":"set_permission_mode requests are queued, re-checked and report clearer errors","tier":"notice","area":"SDK","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.319\/e\/set-permission-mode-serializes-through-a-queue-and-re-valida","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.319","markdown":"### set_permission_mode requests are queued, re-checked and report clearer errors\n\nThe SDK set_permission_mode request now re-checks auto mode when applied, can be queued or overtaken, and returns error codes such as invalid_mode\n\n**What**\n\nThe SDK (the toolkit that lets other programs control Claude Code) can send a `set_permission_mode` request to change the permission mode, which decides how much Claude may do without asking you. This request has changed:\n\n- The auto-mode gate, the check on whether auto mode may be used, is now re-checked when the change is applied. Before, it was checked once, straight away, before the mode was set.\n\n- A request can be overtaken by a later one.\n\n- A request is queued, held to run in order, when a new check says it needs to be.\n\n- An unexpected failure returns the error \"set_permission_mode failed\".\n\n- A request with an invalid mode now gets an error that includes `code: \"invalid_mode\"`. Before, there was no code field.\n\n**Why**\n\nPrograms that change the permission mode several times in quick succession get the changes applied in a predictable order. A program can also check the `invalid_mode` code to tell a bad mode name apart from other failures.\n\n- Area: SDK\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}