Skip to content

Conversation

Wujiaxuan007
Copy link
Contributor

@Wujiaxuan007 Wujiaxuan007 commented Sep 10, 2025

Summary

  • Enhanced RunImpl.stream_step_items_to_queue to properly handle all RunItem types, including handoffs and tool calls.
  • Fixed issue where HandoffCallItem events were lost when using custom handoff input filters (introduced in v0.2.10).
  • Verified that streaming events reflect tool calls, handoff requests, and agent switching.

Test plan

  • Added/updated test_stream_events.py::test_stream_events_main_with_handoff to ensure:
    • Tool call events are emitted in the correct order.
    • Handoff events (HandoffCallItem and HandoffOutputItem) are emitted.
    • The agent switches to the target agent as expected.

Issue number

Fixes #1712

Checks

  • Added/updated relevant tests
  • Verified all tests pass

…fCallItem, are pushed to event_queue

- Added `event_queue` parameter to `_get_single_step_result_from_response`
- Push `processed_response.new_items` to queue in streaming mode
- Non-streaming path (`_run_single_turn`) remains unchanged
- Fixes loss of HandoffCallItem in streaming scenarios
- Add test_stream_events_main_with_handoff test
@Wujiaxuan007 Wujiaxuan007 force-pushed the fix/streaming-step-items branch from bc27593 to a5138d1 Compare September 10, 2025 06:48
@seratch seratch marked this pull request as draft September 11, 2025 01:38
@Wujiaxuan007 Wujiaxuan007 marked this pull request as ready for review September 11, 2025 09:27
@seratch
Copy link
Member

seratch commented Sep 11, 2025

Hi, can you take a look at the CI errors first? It seems most of the jobs are failing now

@seratch seratch marked this pull request as draft September 11, 2025 09:29
@Wujiaxuan007 Wujiaxuan007 force-pushed the fix/streaming-step-items branch from 7062a24 to ca7a854 Compare September 12, 2025 02:37
@Wujiaxuan007 Wujiaxuan007 marked this pull request as ready for review September 12, 2025 03:24
@Wujiaxuan007
Copy link
Contributor Author

Hi @seratch, I’ve fixed all the CI issues in this branch. Could you please approve and run the workflows so the checks can pass?

@seratch
Copy link
Member

seratch commented Sep 12, 2025

@codex review this PR

Copy link

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, or 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 fix this CI failure" or "@codex address that feedback".

Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me 👍

@seratch seratch merged commit 789575f into openai:main Sep 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HandoffCallItem event is missing in v0.2.11

2 participants