{"version":"2.1.251","anchor":"sdk-set-model-waits-for-a-busy-session-instead-of-failing","canonical_anchor":"sdk-set-model-waits-for-a-busy-session-instead-of-failing","heading":"SDK set_model waits for a busy session instead of failing","tier":"use","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251\/e\/sdk-set-model-waits-for-a-busy-session-instead-of-failing","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.251","markdown":"### SDK set_model waits for a busy session instead of failing\n\nSDK set_model now waits for a busy session and applies once idle instead of failing.\n\n**What**\n\nThe SDK `set_model` control request is now asynchronous. If the session is busy or has queued work, the model change is deferred and applied once the session goes idle rather than being forced through. Any notices the change produces are forwarded back to the caller, and a thrown error now replies `set_model failed` instead of leaving the request hanging.\n\n**Details**\n\n- Applies to every `set_model` control request; there is no flag.\n\n**Evidence**\n\n`if (u0(e) || Ek.of(e).pending > 0) lt(() => ng(e, O));\n\nelse await O();`\n\n- Area: SDK\n- Names: `set_model`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5"}