fix(handoffs): avoid orphan reasoning items when nesting handoff history#2504
Closed
OiPunk wants to merge 1 commit intoopenai:mainfrom
Closed
fix(handoffs): avoid orphan reasoning items when nesting handoff history#2504OiPunk wants to merge 1 commit intoopenai:mainfrom
OiPunk wants to merge 1 commit intoopenai:mainfrom
Conversation
Member
|
Closing this in favor of #2508 |
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.
Summary
nest_handoff_historyso standalonereasoningitems are summarized but not forwarded as raw input itemsnew_itemsunchanged for session persistence while filtering only next-agent model inputWhy
With
RunConfig(nest_handoff_history=True), forwarding a rawreasoningitem can produce Responses API 400 errors (...reasoning... without its required following item).Changes
"reasoning"to_SUMMARY_ONLY_INPUT_TYPESinsrc/agents/handoffs/history.pytests/test_extension_filters.py:test_nest_handoff_history_does_not_forward_raw_reasoning_itemstest_nest_handoff_history_skips_tool_approval_itemstest_parse_summary_line_rejects_blank_linesValidation
uv run --with ruff ruff check src/agents/handoffs/history.py tests/test_extension_filters.pyuv run --with mypy mypy src/agents/handoffs/history.pyenv -u ALL_PROXY -u all_proxy -u HTTPS_PROXY -u https_proxy -u HTTP_PROXY -u http_proxy -u NO_PROXY -u no_proxy uv run --with pytest pytest tests/test_extension_filters.py -qenv -u ALL_PROXY -u all_proxy -u HTTPS_PROXY -u https_proxy -u HTTP_PROXY -u http_proxy -u NO_PROXY -u no_proxy uv run --with pytest pytest tests/test_run_step_processing.py -qenv -u ALL_PROXY -u all_proxy -u HTTPS_PROXY -u https_proxy -u HTTP_PROXY -u http_proxy -u NO_PROXY -u no_proxy uv run --with pytest --with pytest-cov pytest tests/test_extension_filters.py tests/test_run_step_processing.py --cov=agents.handoffs.history --cov-report=term-missing -qsrc/agents/handoffs/history.py= 100%Fixes #2503