Skip to content

Python: [Bug]: LocalShellTool's hosted type="shell" tool is not supported on gpt-6-luna-2026-09-22 #8914

Closed

Description

@alkaiserItron

Description

LocalShellTool is advertised to the model API as a hosted type="shell" tool (as_function() tags it kind="shell", which the OpenAI client serializes to type="shell"). gpt-5.6-luna accepted this, but gpt-6-luna-2026-09-22 rejects it and every request 400s before any turn runs:

Error code: 400 - Tool 'shell' is not supported with gpt-6-luna-2026-09-22. (param: tools)

Since the tool actually runs locally via LocalShellTool.run(), the hosted type="shell" declaration isn't needed here — a plain type="function" tool would work on any model.

Request: let LocalShellTool be advertised as a plain function tool (type="function") instead of the hosted type="shell" surface — via an opt-in on get_shell_tool(...) / as_function(...), or a fallback when the model doesn't support the hosted shell tool.

Code Sample

# Self-hosted Foundry agent with a LOCAL shell tool over a per-session sandbox.
shell = LocalShellTool(
    mode="persistent", workdir=run_dir, confine_workdir=True,
    approval_mode="never_require", acknowledge_unsafe=True,
)
agent = create_harness_agent(
    client=FoundryChatClient(
        project_endpoint=..., model="gpt-6-luna", credential=DefaultAzureCredential()
    ),
    shell_executor=shell,
    default_options={
        "store": False,
        "allow_multiple_tool_calls": True,
        "reasoning": {"effort": "medium"},
    },
)
ResponsesHostServer(agent).run()
# The shell tool is serialized as hosted type="shell" (because as_function() sets kind="shell"),
# and the first model call 400s: Tool 'shell' is not supported with gpt-6-luna-2026-09-22.

Error Messages / Stack Traces

agent_framework.exceptions.ChatClientException: ("<class 'agent_framework_foundry._chat_client.FoundryChatClient'> service failed to complete the prompt: Error code: 400 - {'error': {'message': "Tool 'shell' is not supported with gpt-6-luna-2026-09-22.", 'type': 'invalid_request_error', 'param': 'tools', 'code': None, 'request_id': 'fd6660e6e3f1b82fb4a91d2e1372b263'}}", BadRequestError("Error code: 400 - {'error': {'message': "Tool 'shell' is not supported with gpt-6-luna-2026-09-22.", 'type': 'invalid_request_error', 'param': 'tools', 'code': None, 'request_id': 'fd6660e6e3f1b82fb4a91d2e1372b263'}}"))

Package Versions

agent-framework-core: 1.19.0 agent-framework-openai: 1.14.4 agent-framework-foundry: 1.13.1 agent-framework-foundry-hosting: 1.0.0b260918 agent-framework-tools: 1.0.0b260918 agent-framework-monty: 1.0.0b260918 openai: 3.16.2

Python Version

3.11.16

Additional Context

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Sep 30, 2026
  2. changed the issue type fromtoon Sep 30, 2026
  3. removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Sep 30, 2026
  4. manjunathshiva commented on Oct 1, 2026

    @manjunathshiva
    Contributor

    Hi Eduard van Valkenburg (@eavanvalkenburg), I'd like to help with this. I'm checking first because it sits on the hosted/local shell boundary in docs/specs/004-python-function-calling-loop.md.

    It's broader than gpt-6-luna. On an Azure OpenAI gpt-5-mini deployment, create_harness_agent(..., shell_executor=LocalShellTool(...)) fails every request with 400 Tool 'shell' is not supported with gpt-5-mini-2025-08-07 before any turn runs. The same executor declared as type="function" works: the model returns a function_call, and with the default approval_mode="always_require" it stops at a function_approval_request.

    Why an opt-in needs two small pieces. Both providers turn kind="shell" into their native tool (type="shell" for OpenAI/Foundry, bash_20250124 for Anthropic). LocalShellTool.as_function() already carries that kind, and the harness always goes through client.get_shell_tool(...). So the change would be an as_function() option that returns an ordinary function tool, with the same approval mode and sandbox, plus a create_harness_agent option that uses it. Response classification doesn't change, so it doesn't overlap #8720. I'd avoid an automatic fallback on the 400.

    The part that's your call: in function mode, local shell runs through an ordinary function call. The #8294 guard is unaffected (with the tool configured as a shell, a function_call named after it is still informational_only), but function mode makes a generic function call the execution path. Is that acceptable to you, and is this the shape you'd want?

  5. alkaiserItron commented on Oct 1, 2026

    @alkaiserItron
    Author

    Eduard van Valkenburg (@eavanvalkenburg) Why was this closed? I do not see a linked PR, was this addressed in a separate issue?

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

Metadata

Metadata

Labels

agentsUsage: [Issues, PRs], Target: Single agentpythonUsage: [Issues, PRs], Target: Python

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions