Skip to content

Python: [Bug]: run_skill_script approval handshake leaves function call unanswered in local Inspector (Responses API) #7267

Closed

Description

Description

Bug: run_skill_script approval handshake leaves function call unanswered in local Inspector

Environment

agent-framework-foundry-hosting 1.0.0b260721
agent-framework-foundry 1.10.2
Agent type ResponsesHostServer (Responses API)
Run mode Local (azd ai agent run)
Inspector Agent Inspector (VS Code / Foundry Toolkit)
OS Windows 11

Description

When using a SkillsProvider with a script_runner and the default approval mode, approving the run_skill_script tool call in the Agent Inspector does not complete correctly. The tool block shows a red ✗ and the function call result is never submitted back to the Responses API. On the next turn the API rejects the request with a 400 error.


Steps to Reproduce

  1. Create an agent with a file-based skill and a script_runner (you can use the 07-skills example provided by Microsoft):

    skills_provider = SkillsProvider.from_paths(
        skill_paths=Path(__file__).parent / "skills",
        script_runner=run_local_skill_script,
        # default: approvals enabled for all tools
    )
    agent = Agent(client=client, context_providers=[skills_provider], ...)
    server = ResponsesHostServer(agent)
    server.run()
  2. Start the agent locally with azd ai agent run or F5 to start the service and open the Agent Inspector

  3. Open the Agent Inspector and send a message that triggers run_skill_script (e.g. "Greet me" with a greet-user skill).

  4. The Inspector shows an approval dialog for load_skill → approve it. ✅

  5. The Inspector shows run_skill_script but stays there forever


Actual Behavior

  • After run_skill_script, the tool block shows a red ✗ and the agent hangs.

  • The script runner function is never called (confirmed by adding logging before and inside the function — the entry log never appears).

  • On the next conversation turn, the Responses API returns:

    server_error: (
      "<class 'agent_framework_foundry._chat_client.FoundryChatClient'> service failed to complete the prompt:
       Error code: 400 - {'error': {'message': 'No tool output found for function call call_<id>.',
       'type': 'invalid_request_error', 'param': 'input', 'code': None}}",
      BadRequestError(...)
    )
    

Expected Behavior

After the approval, the framework should:

  1. Call the registered script_runner.
  2. Submit the returned string as the tool output to the Responses API.
  3. Allow the model to continue and produce a final reply.

Root Cause Hypothesis

The approval round-trip for run_skill_script uses the Responses API's function call / tool output mechanism. After the user clicks Approve in the Inspector, the hosting layer (ResponsesHostServer) fails to deliver the tool output back to the API in the follow-up request, leaving the function call call_<id> dangling. The API then rejects the next request because the conversation history contains an unresolved function call with no corresponding tool output.

The script_runner itself is never invoked — the failure occurs inside the framework before the runner is reached.


Workaround

Pass disable_run_skill_script_approval=True (and optionally disable_load_skill_approval=True) to SkillsProvider.from_paths(). This is safe for trusted local scripts and bypasses the broken approval round-trip entirely:

skills_provider = SkillsProvider.from_paths(
    skill_paths=Path(__file__).parent / "skills",
    script_runner=run_local_skill_script,
    disable_load_skill_approval=True,
    disable_run_skill_script_approval=True,
)

### Code Sample

```markdown

Error Messages / Stack Traces

: (
      "<class 'agent_framework_foundry._chat_client.FoundryChatClient'> service failed to complete the prompt:
       Error code: 400 - {'error': {'message': 'No tool output found for function call call_<id>.',
       'type': 'invalid_request_error', 'param': 'input', 'code': None}}",
      BadRequestError(...)
    )

Package Versions

agent-framework-foundry-hosting: 1.0.0b260721, agent-framework-foundry: 1.10.2

Python Version

Python 3.13

Additional Context

With default approval values:
Screenshot 1: Waiting for approval
Image

Screenshot 2: After approval was accepted

Image

Screenshot 3: In second round (entered the same prompt to trigger the skill, 'Greet me')

Image

After the workaround:

Screenshot 4: After disabling the approvals
Image

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Jul 22, 2026
  2. added
    hostingUsage: [Issues, PRs], Target: all hosting related solutions
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Jul 23, 2026
  3. herohua commented on Jul 23, 2026

    @herohua
    Member

    We observed the same error with approval-gated run_shell in Agent Inspector. After approval, the follow-up response immediately fails with “No tool output found.” Disabling shell approval avoids the issue. Could this be due to the same underlying root cause?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

hostingUsage: [Issues, PRs], Target: all hosting related solutionspythonUsage: [Issues, PRs], Target: Python

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions