Skip to content

[Bug]: Responses API fails to parse shell tools and shell output items #810

Description

@omitech

Description

A valid Responses API request using the shell tool can succeed on OpenAI's side, but the client throws while parsing the response instead of returning a result.

Two independent dispatch failures occur:

  • tools[].type = shell: UnhandledMatchError in Actions/Responses/ToolObjects.php.
  • output[].type = shell_call or shell_call_output: UnexpectedValueException in Actions/Responses/OutputObjects.php.

The client already forwards shell environment and skill attachment parameters. toArray() cannot work around this because parsing fails before the result object is constructed.

Steps To Reproduce

Call responses()->create() with a shell-capable model, tools containing type shell and environment type container_auto, and an input requesting execution of a simple shell command. Observe that the client throws when the response contains shell tool definitions or output items.

For an independent offline reproduction, use the existing CreateResponse fixture with output = [] and tools = [{type: shell, environment: {type: container_auto}}]. For the second failure, use tools = [] and a valid shell_call or shell_call_output item in output.

OpenAI PHP Client Version

v0.20.1

PHP Version

8.3.28

Notes

Proposed support: typed shell tools, environments and skill attachments; shell_call and shell_call_output; ordinary responses, streaming, stored input items, conversations and serialization. No changes to request parameter forwarding or a local command executor are needed.

Related Skills API implementation: #808
Shell documentation: https://developers.openai.com/api/docs/guides/tools-shell
Skills documentation: https://developers.openai.com/api/docs/guides/tools-skills

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions