Commit a56ce0a
fix: prime server conversation tracker in streaming path to prevent message duplication
When resuming a streaming run from RunState, the server conversation tracker
was not being primed with previously sent model responses. This caused
`prepare_input` to treat all previously generated items as unsent and
resubmit them to the server, breaking conversation threading.
**Issue**: Missing `track_server_items` call in streaming resumption path
**Fix**: Added server conversation tracker priming logic in `_start_streaming`
method (lines 1076-1079) to match the non-streaming path implementation
(lines 553-556).
The fix iterates through `run_state._model_responses` and calls
`track_server_items(response)` to mark them as already sent to the server.
**Impact**: Resolves message duplication when resuming interrupted streaming
runs, ensuring proper conversation threading with server-side sessions.
Fixes code review feedback from PR openai#2021
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 74c50fd commit a56ce0a
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1076 | 1081 | | |
1077 | 1082 | | |
1078 | 1083 | | |
| |||
0 commit comments