Skip to content

Bug/mcp-error-handling #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

msitarzewski
Copy link
Contributor

test: enhance error handling tests for OutputMcpCall response

What:

  • Bug Fix
  • New Feature

Description:

Added support for handling various MCP call error formats in the OutputMcpCall class. The implementation now properly parses and normalizes error messages returned from OpenAI's MCP calls, regardless of the format they're presented in:

  • Direct content arrays with text elements
  • Object with nested content arrays
  • Simple string errors
  • Complex error structures that get JSON-encoded

This ensures that users of the library can consistently access error messages from MCP calls without having to handle different response structures themselves.

Related:

N/A

- `CreateStreamedResponse.php` - Added streaming support for code interpreter
- `OutputCodeInterpreterToolCall.php` - New file for code interpreter output handling
- `OutputMessageContentOutputTextAnnotationsContainerFile.php` - New file for container file annotations
- `OutputMessageContentOutputText.php` - Updated to support container file annotations
- `CodeInterpreterCall.php` - New streaming event handler
- `OutputTextAnnotationAdded.php` - New streaming event for text annotations
- `CodeInterpreterCodeDone.php` - New streaming event for code completion
- `CodeInterpreterCodeDelta.php` - New streaming event for code deltas
- `OutputItem.php` - Updated to handle code interpreter outputs
- `CodeInterpreterTool.php` - New tool type definition
… code interpreter responses

composer test now reports:
• 896 PHPUnit tests PASS
• Laravel Pint style PASS
• php-stan level passes with zero errors.
test: enhance error handling tests for OutputMcpCall response
@iBotPeaches
Copy link
Collaborator

You might have to rebase your branch. I think you based it off your older branch, prior to the squash merge into main.

@iBotPeaches iBotPeaches marked this pull request as draft July 3, 2025 15:27
@iBotPeaches
Copy link
Collaborator

Marking as draft in meantime. Conflicting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants