fix: unpack StreamingThinkScrubber tuple in streaming delta paths - #37382
fix: unpack StreamingThinkScrubber tuple in streaming delta paths#37382lld1995 wants to merge 1 commit into
Conversation
…eset_stream_delivery_tracking StreamingThinkScrubber.feed() and flush() both return a (visible, reasoning) tuple, but two call sites assigned the entire tuple back to the 'text' variable, causing 'can only concatenate str (not "tuple") to str' on every API call. - _fire_stream_delta (hot path, every streaming delta) - _reset_stream_delivery_tracking (end-of-stream flush)
|
This PR unpacks # agent/think_scrubber.py on main:
def feed(self, text: str) -> str: # line 106
def flush(self) -> str: # line 204Merging this PR without the scrubber change would cause I see that your PR #23638 modifies Suggestion: either:
Also, the PR body says "StreamingThinkScrubber.feed()/flush() return a (visible, reasoning) tuple" as if it's current behavior — but it's not on main. Adding a "depends on #23638" note would help reviewers understand the stacking. |
|
Closing this PR. As the reviewer correctly pointed out, this change only includes the The fix is already fully and self-containedly covered by #23638, which changes |
Every API call through the chat-completions transport failed with can only concatenate str (not tuple) to str. StreamingThinkScrubber.feed()/flush() return a (visible, reasoning) tuple but two call sites in run_agent.py assigned the whole tuple to text; the tuple later hit a str+ concat. Fixed by unpacking at _fire_stream_delta (hot path) and _reset_stream_delivery_tracking (end-of-stream flush). Verified locally and against the updated container image.