feat(OpenAI): add shell tool and skill attachments support - #811
Merged
iBotPeaches merged 1 commit intoOct 3, 2026
Merged
Conversation
- Introduced ShellTool class to handle shell command execution with various environments. - Updated HostedToolChoice to include 'shell' as a valid type. - Created fixtures for shell call actions, outputs, and outcomes for testing. - Implemented streaming responses for shell commands and outputs. - Added tests for parsing and creating shell tools and outputs, ensuring proper handling of environments and execution limits. - Enhanced response handling to support shell-related events and outputs.
Contributor
Author
|
Fixes #810 |
Collaborator
Wrote a little script to test this for real, no issues. All worked. Going to add Copilot since my skimming of code seemed fine to see if it finds anything, otherwise g2g. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The broad API surface and unverified live skill and streaming behavior require final human review.
Review effort: Lite
Findings: None
What changed in this PR
Adds typed Responses API support for the shell tool, including skills, environments, shell outputs, streaming events, and serialization across response pathways.
Changes:
- Adds shell tools, skills, containers, actions, outcomes, and tool choices.
- Supports shell items in responses, conversations, stored inputs, and streams.
- Adds fixtures, regression tests, and README documentation.
| File | Summary |
|---|---|
tests/Responses/Responses/Tool/ShellTool.php |
Tests shell tool parsing. |
tests/Responses/Responses/Output/OutputShellCallOutput.php |
Tests shell output parsing. |
tests/Responses/Responses/Output/OutputShellCall.php |
Tests shell call parsing. |
tests/Responses/Responses/ListInputItems.php |
Tests stored shell items. |
tests/Responses/Responses/CreateStreamedResponse.php |
Tests shell streaming. |
tests/Responses/Responses/CreateResponse.php |
Tests shell response parsing. |
tests/Responses/Conversations/ConversationItem.php |
Tests conversation shell items. |
tests/Resources/Responses.php |
Tests shell response requests. |
tests/Fixtures/Streams/ResponseShell.txt |
Provides shell stream data. |
tests/Fixtures/Responses.php |
Registers shell fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellToolFixture.php |
Provides shell tool fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellSkillReferenceFixture.php |
Provides skill reference fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellLocalSkillFixture.php |
Provides local skill fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellLocalEnvironmentFixture.php |
Provides environment fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellInlineSkillSourceFixture.php |
Provides inline source fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellInlineSkillFixture.php |
Provides inline skill fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellContainerReferenceFixture.php |
Provides container reference fixtures. |
src/Testing/Responses/Fixtures/Responses/Tool/ShellContainerAutoFixture.php |
Provides automatic container fixtures. |
src/Testing/Responses/Fixtures/Responses/Streaming/ShellCallOutputContentDoneFixture.php |
Provides completed output fixtures. |
src/Testing/Responses/Fixtures/Responses/Streaming/ShellCallOutputContentDeltaFixture.php |
Provides output delta fixtures. |
src/Testing/Responses/Fixtures/Responses/Streaming/ShellCallCommandFixture.php |
Provides command event fixtures. |
src/Testing/Responses/Fixtures/Responses/Streaming/ShellCallCommandDeltaFixture.php |
Provides command delta fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/ShellCallOutcome/OutputShellCallOutcomeTimeoutFixture.php |
Provides timeout fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/ShellCallOutcome/OutputShellCallOutcomeExitFixture.php |
Provides exit fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/OutputShellCallOutputFixture.php |
Provides shell output fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/OutputShellCallOutputContentFixture.php |
Provides output content fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/OutputShellCallFixture.php |
Provides shell call fixtures. |
src/Testing/Responses/Fixtures/Responses/Output/OutputShellCallActionFixture.php |
Provides shell action fixtures. |
src/Responses/Responses/ToolChoice/HostedToolChoice.php |
Adds shell tool choice typing. |
src/Responses/Responses/Tool/ShellTool.php |
Models shell tools. |
src/Responses/Responses/Tool/ShellSkillReference.php |
Models skill references. |
src/Responses/Responses/Tool/ShellLocalSkill.php |
Models local skills. |
src/Responses/Responses/Tool/ShellLocalEnvironment.php |
Models local environments. |
src/Responses/Responses/Tool/ShellInlineSkillSource.php |
Models inline skill sources. |
src/Responses/Responses/Tool/ShellInlineSkill.php |
Models inline skills. |
src/Responses/Responses/Tool/ShellContainerReference.php |
Models container references. |
src/Responses/Responses/Tool/ShellContainerAuto.php |
Models automatic containers. |
src/Responses/Responses/Streaming/ShellCallOutputContentDone.php |
Parses completed output events. |
src/Responses/Responses/Streaming/ShellCallOutputContentDelta.php |
Parses output delta events. |
src/Responses/Responses/Streaming/ShellCallCommandDelta.php |
Parses command deltas. |
src/Responses/Responses/Streaming/ShellCallCommand.php |
Parses command events. |
src/Responses/Responses/Streaming/OutputItem.php |
Supports streamed shell items. |
src/Responses/Responses/RetrieveResponse.php |
Serializes retrieved shell responses. |
src/Responses/Responses/Output/ShellCallOutcome/OutputShellCallOutcomeTimeout.php |
Models timeout outcomes. |
src/Responses/Responses/Output/ShellCallOutcome/OutputShellCallOutcomeExit.php |
Models exit outcomes. |
src/Responses/Responses/Output/OutputToolSearchOutput.php |
Supports shell tools in tool-search output. |
src/Responses/Responses/Output/OutputShellCallOutputContent.php |
Models output chunks. |
src/Responses/Responses/Output/OutputShellCallOutput.php |
Models shell outputs. |
src/Responses/Responses/Output/OutputShellCallAction.php |
Models shell actions. |
src/Responses/Responses/Output/OutputShellCall.php |
Models shell calls. |
src/Responses/Responses/ListInputItems.php |
Supports stored shell items. |
src/Responses/Responses/CreateStreamedResponse.php |
Dispatches shell stream events. |
src/Responses/Responses/CreateResponse.php |
Supports shell response objects. |
src/Responses/Conversations/ConversationItem.php |
Supports conversation shell items. |
src/Actions/Responses/ToolObjects.php |
Parses shell tools. |
src/Actions/Responses/ToolChoiceObjects.php |
Parses shell choices. |
src/Actions/Responses/OutputObjects.php |
Parses shell outputs. |
src/Actions/Responses/ItemObjects.php |
Parses stored shell items. |
src/Actions/Conversations/ItemObjects.php |
Parses conversation shell items. |
README.md |
Documents hosted shell usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
|
Tested here - iBotPeaches/openai-php-laravel-test@d29a934 |
iBotPeaches
approved these changes
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
Successful Responses API requests using shell currently throw when the client encounters shell tool definitions or
shell_call/shell_call_outputitems. This change returns typed results and supports serialization across create, retrieve, stored input items and conversations.Adds
container_auto,container_referenceand local environment descriptions,skill_referenceand inline attachments, local skill descriptions, shell actions and output chunks, exit and timeout outcomes, and shell tool choice. Supports the five shell command/output streaming events and output item events through response.completed. Request forwarding, existing MCP support and local execution responsibilities remain unchanged.Includes standard fake fixtures, focused regression tests and a README example. The existing Skills API resource added by #808 is reused.
Validation:
fixes: #810