Commit ba0f4b7
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 30bb3e9 commit ba0f4b7
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1130 | 1135 | | |
1131 | 1136 | | |
1132 | 1137 | | |
| |||
0 commit comments