{"version":"2.1.281","anchor":"sdk-client-now-holds-control-requests-and-mcp-messages-until","canonical_anchor":"sdk-client-now-holds-control-requests-and-mcp-messages-until","heading":"SDK client now holds control requests and MCP messages until initialize has been written","tier":null,"area":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/sdk-client-now-holds-control-requests-and-mcp-messages-until","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### SDK client now holds control requests and MCP messages until `initialize` has been written\n\nThe SDK client now waits for `initialize` to be sent before sending any other request or MCP message\n\n**What**\n\nThe SDK is the kit for driving Claude Code from your own program. Its Query class opens with an `initialize` message, and it now holds everything else until that message has been written:\n\n- `request()` waits for `initialize`, and fails at once with \"Query closed before response received\" once the query has been cleaned up\n\n- `control_cancel_request` is sent only if the original request actually went out\n\n- `streamInput` waits for `initialize`\n\n- messages from SDK MCP servers (tool providers run inside your program) go through `writeAfterInitialize`\n\n- late replies to a manifest capture are dropped\n\n- removing a server rejects its pending requests\n\n**Why**\n\nPrograms built on the SDK no longer send messages out of order at startup. They also no longer wait forever for replies after a query has closed or a server has been removed."}