Skip to content

fix: Responses context-management extra_args collision - #3185

Merged
alfozan merged 1 commit into
mainfrom
alfozan/fix-responses-context-management-extra-args
May 7, 2026
Merged

alfozan merged 1 commit into
mainfrom
alfozan/fix-responses-context-management-extra-args

Conversation

@alfozan

@alfozan alfozan commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix a false duplicate-argument error when a Responses request parameter is supplied through ModelSettings.extra_args and the first-class request field is only present as OpenAI's omit sentinel.

Test plan

  • make format
  • make lint
  • uv run pytest tests/models/test_openai_responses.py::test_build_response_create_kwargs_allows_extra_arg_when_explicit_arg_is_omitted tests/models/test_openai_responses.py::test_build_response_create_kwargs_rejects_duplicate_context_management_extra_args tests/models/test_openai_responses.py::test_build_response_create_kwargs_rejects_duplicate_extra_args_keys -q
  • uv run mypy src/agents/models/openai_responses.py tests/models/test_openai_responses.py
  • uv run pyright src/agents/models/openai_responses.py tests/models/test_openai_responses.py
  • git diff --check

Issue number

N/A

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass where not blocked by unrelated local-only failures

@github-actions github-actions Bot added bug Something isn't working feature:core labels May 7, 2026
@seratch seratch added this to the 0.16.x milestone May 7, 2026

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me; let's see if Codex says 👍

@alfozan

alfozan commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@alfozan
alfozan merged commit ee36d43 into main May 7, 2026
10 checks passed
@alfozan
alfozan deleted the alfozan/fix-responses-context-management-extra-args branch May 7, 2026 23:23
@alfozan alfozan changed the title Fix Responses extra_args collision with omitted kwargs fix: Responses context-management extra_args collision May 8, 2026
@seratch seratch modified the milestones: 0.16.x, 0.17.x May 8, 2026
RudrenduPaul pushed a commit to RudrenduPaul/openai-agents-python that referenced this pull request Jun 21, 2026
### Summary

Fix a false duplicate-argument error when a Responses request parameter
is supplied through `ModelSettings.extra_args` and the first-class
request field is only present as OpenAI's `omit` sentinel.

### Test plan

- `make format`
- `make lint`
- `uv run pytest
tests/models/test_openai_responses.py::test_build_response_create_kwargs_allows_extra_arg_when_explicit_arg_is_omitted
tests/models/test_openai_responses.py::test_build_response_create_kwargs_rejects_duplicate_context_management_extra_args
tests/models/test_openai_responses.py::test_build_response_create_kwargs_rejects_duplicate_extra_args_keys
-q`
- `uv run mypy src/agents/models/openai_responses.py
tests/models/test_openai_responses.py`
- `uv run pyright src/agents/models/openai_responses.py
tests/models/test_openai_responses.py`
- `git diff --check`

### Issue number

N/A

### Checks

- [x] I've added new tests (if relevant)
- [ ] I've added/updated the relevant documentation
- [x] I've run `make lint` and `make format`
- [x] I've made sure tests pass where not blocked by unrelated
local-only failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants