Skip to content

test: add regression test for nested ExceptionGroups in call_tool#3675

Closed
mshsheikh wants to merge 1 commit into
openai:mainfrom
mshsheikh:patch-49
Closed

test: add regression test for nested ExceptionGroups in call_tool#3675
mshsheikh wants to merge 1 commit into
openai:mainfrom
mshsheikh:patch-49

Conversation

@mshsheikh

Copy link
Copy Markdown
Contributor

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.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +73 to +74
inner_group = BaseExceptionGroup("inner_failures", [http_error])
outer_group = BaseExceptionGroup("outer_failures", [inner_group])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codex, but this failure is entirely intentional. As requested by the maintainer, this is a regression test designed to fail on the base revision. The implementation that fixes this (the recursive extraction) is waiting in PR #3556.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seratch

seratch commented Jun 22, 2026

Copy link
Copy Markdown
Member

Add this to #3556

@seratch seratch closed this Jun 22, 2026
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