microsoft / microsoft/agent-framework
Python: [Bug]: Cannot approve tool usage from sub-agents
@giles17 is already working on this.
Since Mar 30, 2026.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 2d 45m
- Merged PRs (30d)
- 358
Description
### 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.