Commit d7c81b5
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 <[email protected]>1 parent 28f4ff6 commit d7c81b5
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1089 | 1094 | | |
1090 | 1095 | | |
1091 | 1096 | | |
| |||
0 commit comments