From 45f34794fbe2b659c47d20b5c6f3a9bbd12cc7c5 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sun, 22 Mar 2026 22:38:23 +0300 Subject: [PATCH] Retrieving specific field for TextBlock and ThinkingBlock --- src/claude/sdk_integration.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/claude/sdk_integration.py b/src/claude/sdk_integration.py index ab9c4046..bfb50a6c 100644 --- a/src/claude/sdk_integration.py +++ b/src/claude/sdk_integration.py @@ -20,6 +20,8 @@ PermissionResultDeny, ProcessError, ResultMessage, + TextBlock, + ThinkingBlock, ToolPermissionContext, ToolUseBlock, UserMessage, @@ -496,13 +498,15 @@ async def _handle_stream_message( if isinstance(block, ToolUseBlock): tool_calls.append( { - "name": getattr(block, "name", "unknown"), - "input": getattr(block, "input", {}), - "id": getattr(block, "id", None), + "name": block.name, + "input": block.input, + "id": block.id, } ) - elif hasattr(block, "text"): + elif isinstance(block, TextBlock): text_parts.append(block.text) + elif isinstance(block, ThinkingBlock): + text_parts.append(block.thinking) if text_parts or tool_calls: update = StreamUpdate(