mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #300] Critical: bug: a cut stream leaves truncated tool-call arguments, json.loads on the accumulator kills the whole chat task and persists an error turn every retry #213
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Classic298 on GitHub (Sep 21, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/300
Same root cause as #252 (the unguarded
json.loads), but this is the sharper end of it: what happens when the accumulator is not just empty but truncated mid-string by a cut stream, and what it does to the chat. Filing separately because the blast radius is different from the "empty/short JSON" case there.What happened, on cptr 0.9.21 behind an OpenAI-compatible proxy:
The proxy cut the SSE stream mid-argument (broken pipe on its side, logged at the same second as the crash). cptr had accumulated
arguments_jsonby concatenating deltas, and the accumulation ended mid-string:{"content": "\"\"\"Regression tests for ...and then nothing. When a later chunk carriedfinish_reason: tool_calls, cptr ranjson.loadson that truncated string and raised:at
json.loads(tc["arguments_json"])insidestream_openai_completions, which propagates straight out of the async generator intorun_chat_task's genericexcept Exception. So the whole chat task dies, not just the tool call.The consequences that make this worse than a one-off 500:
Unterminated stringerror block. The user sees the model "reply" with a wall of the same error and cannot get work done; each failed turn consumes a full model call including all the reasoning tokens.> **Error:** Unterminated string...branches that then ride along in the context for every subsequent attempt, burning tokens and burying the actual work.Two things would fix this cleanly:
json.loads, fall back to whatever lenient extraction exists, and on total failure fail that tool call with an error the model can see and retry, instead of raising out of the stream loop and killing the task.The today-workaround for anyone hitting this: nothing on the cptr side, it needs the guard. If your provider is a proxy, the cuts that produce truncated arguments show up as broken pipes or read timeouts in the proxy log, and a proxy that retries internally or keeps the connection alive makes it rare. That is mitigation, not a fix.
@owui-terminator[bot] commented on GitHub (Sep 21, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
This is the direct parent issue for the same bug class: unguarded
json.loadson streamed tool-call arguments. Your report is the more specific cut-stream case where the accumulator is truncated mid-string, but it has the same crash point and failure mode.by 1-kabir
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.