test: add regression test for nested ExceptionGroups in call_tool#3675
test: add regression test for nested ExceptionGroups in call_tool#3675mshsheikh wants to merge 1 commit into
ExceptionGroups in call_tool#3675Conversation
This test verifies that nested HTTP errors inside ExceptionGroups are recursively extracted and properly mapped to a UserError, fulfilling the maintainer request in PR openai#3556.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f2c4b0717
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| inner_group = BaseExceptionGroup("inner_failures", [http_error]) | ||
| outer_group = BaseExceptionGroup("outer_failures", [inner_group]) |
There was a problem hiding this comment.
Implement recursive extraction before adding nested group test
With this nested ExceptionGroup, call_tool() still re-raises the group instead of producing UserError because src/agents/mcp/server.py::_extract_http_error_from_exception only checks direct children of e.exceptions and does not recurse into inner_group. As written, this new regression test fails in CI until the production extraction logic is updated to handle nested groups.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Note
To use Codex here, create a Codex account and connect to github.
|
Add this to #3556 |
This test verifies that nested HTTP errors inside ExceptionGroups are recursively extracted and properly mapped to a UserError, fulfilling the maintainer request in PR #3556.