diff --git a/agentflow/core/graph/agent_internal/execution.py b/agentflow/core/graph/agent_internal/execution.py index 2c71c8a..4e82647 100644 --- a/agentflow/core/graph/agent_internal/execution.py +++ b/agentflow/core/graph/agent_internal/execution.py @@ -328,15 +328,14 @@ async def execute( is_stream = config.get("is_stream", False) - if state.context and state.context[-1].role == "tool": - response = await self._call_llm_with_retry(messages=messages, stream=is_stream) - else: - tools = await self._resolve_tools(container) - response = await self._call_llm_with_retry( - messages=messages, - tools=tools if tools else None, - stream=is_stream, - ) + # Always resolve tools - even after tool results, the model may want to call + # additional tools (e.g., Gemini 2.5+ with sequential tool calls) + tools = await self._resolve_tools(container) + response = await self._call_llm_with_retry( + messages=messages, + tools=tools if tools else None, + stream=is_stream, + ) converter_key = self._get_converter_key() return ModelResponseConverter(response, converter=converter_key) diff --git a/agentflow/runtime/protocols/a2a/_optional.py b/agentflow/runtime/protocols/a2a/_optional.py index 59784cf..b624117 100644 --- a/agentflow/runtime/protocols/a2a/_optional.py +++ b/agentflow/runtime/protocols/a2a/_optional.py @@ -8,8 +8,7 @@ A2A_EXTRA_INSTALL_HINT = ( - "Install it with 'pip install 10xscale-agentflow[a2a_sdk]' " - "or 'pip install a2a-sdk'." + "Install it with 'pip install 10xscale-agentflow[a2a_sdk]' " "or 'pip install a2a-sdk'." )