Python: [Bug]: Cannot approve tool usage from sub-agents

Author: johnliu55-msftCreated Mar 29, 2026Updated Sep 18, 2026
Labelsbugpythonagents

Description

When a sub-agent is used via .as_tool() and its inner tool requires approval_mode="always_require", the approval request correctly propagates to the caller. However, sending the approval response back and resuming does not work. The inner tool is never executed.

Code Sample

python
async def nonstreaming():
    chat_client = SomeChatClient()

    @tool(approval_mode="always_require")
    def get_weather_detail(location: Annotated[str, "The city and state, e.g. San Francisco, CA"]) -> str:
        answer = f"The weather in {location} is cloudy with a high of 15°C, humidity 88%."
        return answer

    # Create weather assistant as inner agent
    inner_agent = chat_client.as_agent(
        instructions="You are a helpful assistant that provides weather information to users.",
        description="Agent that provides weather information.",
        name="weather_agent",
        tools=[get_weather_detail],
    )

    # Create main Agent that uses inner agent as tool
    outer_agent = chat_client.as_agent(
        instructions=(
            "You are a helpful coordinator. When a user asks about weather, "
            "use the weather_agent_tool to get the information."
        ),
        description="Coordinator agent that delegates to the weather agent tool.",
        name="coordinator_agent",
        tools=[
            inner_agent.as_tool(
                name="weather_agent_tool",
                description="A weather agent tool that provides current weather information for any given location.",
                approval_mode='never_require'
            )
        ],
    )

    user_input = "What's the weather like in Amsterdam?"
    session = outer_agent.create_session()

    response = await outer_agent.run(user_input, session=session)
    new_inputs: list[Message] = []
    if response.user_input_requests:
        for req in response.user_input_requests:
            print(f'User input requested - Func name: {req.function_call.name}, Args: {req.function_call.arguments}')
            new_inputs.append(Message("user", [req.to_function_approval_response(True)]))

    print("\nRunning agent with new inputs after approvals...\n")
    response2 = await outer_agent.run(new_inputs, session=session)
    print(f"Final response: {response2}")

Error Messages / Stack Traces

markdown
Result:

User input requested - Func name: get_weather_detail, Args: {"location":"Amsterdam, Netherlands"}

Running agent with new inputs after approvals...

Final response: I'm fetching the current weather in Amsterdam for you. One moment!


Here is the output when the tool approval model is set to `never_require`

Running agent with new inputs after approvals...

Final response: The current weather in Amsterdam is cloudy, with a high of 15°C and a humidity level of 88%.

Package Versions

agent-framework-core: 1.0.0rc5

Python Version

Python 3.12.12

Additional Context

  • The bug occurred in both streaming and non-streaming mode.
  • Tested on Workflow.as_tool(), doesn't work either.

Source: microsoft/agent-framework