Skip to content

Commit 9a90bd4

Browse files
committed
fix: keep stdin open for can_use_tool permission responses
1 parent f8b9ec9 commit 9a90bd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/claude_agent_sdk/_internal/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ async def wait_for_result_and_end_input(self) -> None:
922922
follow-up turn, which ends in such a result), or in _read_messages'
923923
finally block if the process exits early.
924924
"""
925-
if self.sdk_mcp_servers or self.hooks:
925+
if self.sdk_mcp_servers or self.hooks or self.can_use_tool:
926926
logger.debug(
927927
"Waiting for a run-ending result before closing stdin "
928928
f"(sdk_mcp_servers={len(self.sdk_mcp_servers)}, "

0 commit comments

Comments
 (0)