From 4f942a3b3f11d9fc0f79c318a635a8e0ed0b9615 Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Mon, 1 Jun 2026 23:01:55 -0700 Subject: [PATCH] Fix mypy --- python/packages/core/agent_framework/_workflows/_agent.py | 6 +++--- .../core/agent_framework/_workflows/_agent_executor.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/packages/core/agent_framework/_workflows/_agent.py b/python/packages/core/agent_framework/_workflows/_agent.py index 4feb2e4086..b1d8511e7a 100644 --- a/python/packages/core/agent_framework/_workflows/_agent.py +++ b/python/packages/core/agent_framework/_workflows/_agent.py @@ -727,8 +727,8 @@ class WorkflowAgent(BaseAgent): for message in input_messages: for content in message.contents: if content.type == "function_approval_response": - request_id: str = content.id # pyright: ignore[reportAssignmentType] - function_call: Content = content.function_call # type: ignore[attr-defined] + request_id: str = content.id # type: ignore[assignment] + function_call: Content = content.function_call # type: ignore[assignment] # Parse the function arguments to recover request payload if function_call.name != self.REQUEST_INFO_FUNCTION_NAME: # This response is for a raw approval request that is itself already an @@ -753,7 +753,7 @@ class WorkflowAgent(BaseAgent): function_responses[request_id] = parsed_args.data elif content.type == "function_result": response_data = content.result if hasattr(content, "result") else str(content) # type: ignore[attr-defined] - function_responses[content.call_id] = response_data # pyright: ignore[reportArgumentType] + function_responses[content.call_id] = response_data # type: ignore[argument-type] else: raise AgentInvalidResponseException( "Unexpected content type while awaiting request info responses." diff --git a/python/packages/core/agent_framework/_workflows/_agent_executor.py b/python/packages/core/agent_framework/_workflows/_agent_executor.py index 1b5eca6eaa..d96929ce79 100644 --- a/python/packages/core/agent_framework/_workflows/_agent_executor.py +++ b/python/packages/core/agent_framework/_workflows/_agent_executor.py @@ -436,7 +436,7 @@ class AgentExecutor(Executor): total_message_content_count = sum(len(msg.contents) for msg in response.messages) if user_input_request_count != total_message_content_count: logger.warning( - "Response %d contains %d user input requests but total message contents are %d. " + "Response %s contains %d user input requests but total message contents are %d. " "This indicates the response contains both user input requests and message contents. " "Double check if this is the intended behavior, as non user input request contents in " "this response will not be emitted.", @@ -492,7 +492,7 @@ class AgentExecutor(Executor): total_message_content_count = len(update.contents) if user_input_request_count != total_message_content_count: logger.warning( - "Response update %d contains %d user input requests but total message contents are %d. " + "Response update %s contains %d user input requests but total message contents are %d. " "This indicates the response update contains both user input requests and message contents. " "Double check if this is the intended behavior, as non user input request contents will " "not be emitted.",