What
The internal 'leave questions standing' mode, which rejected pending permission and question prompts with "the session is being torn down" when a session shut down, has been removed. This affects sessions driven through the SDK or stream-json, where another program hosts Claude Code and answers its prompts.
leaveQuestionsStanding, theleftStandingstate, thequestionsLeftStandinghook and the teardown rejection message are gone.questionsFrozen()no longer depends on it.handleElicitationno longer returns cancel because questions were left standing; it cancels only when input is closed or the request was aborted.- Only the shutdown check now decides whether a
control_responseis left for the next process, and replies left standing are no longer counted. - When the host owns standard input, successful
can_use_toolanswers that were not forwarded are recorded inhostDialogAnsweredRequestIds. Settling a prompt clears that list. - When no prompt is left pending, the session state flips back from requires-action.
Why
This changes what happens to pending permission prompts when an SDK or remote session is torn down mid-question: they are no longer rejected through a separate teardown mode. Hosts that relied on the teardown message should check how their pending prompts now settle.