Read (tool_use_id, content, is_error) from either block shape.
(block: Any)
| 78 | |
| 79 | |
| 80 | def _tool_result_fields(block: Any) -> tuple[str, Any, bool]: |
| 81 | """Read (tool_use_id, content, is_error) from either block shape.""" |
| 82 | if isinstance(block, ToolResultBlock): |
| 83 | return block.tool_use_id, block.content, bool(block.is_error) |
| 84 | return ( |
| 85 | block.get("tool_use_id", ""), |
| 86 | block.get("content", ""), |
| 87 | bool(block.get("is_error")), |
| 88 | ) |
| 89 | |
| 90 | |
| 91 | def run_query_as_agent_loop_sync( |
no test coverage detected