bug: unguarded json.loads on streamed tool-call arguments crashes the request on empty/truncated JSON
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Locate the shared extract_json() helper and the streaming argument parsing paths for Anthropic, OpenAI chat completions, OpenAI Responses, plus Anthropic history replay. Trace how empty or truncated payloads currently reach json.loads(), then verify that malformed streaming input produces a descriptive tool-specific error and corrupt history degrades to {} without aborting the request.
Written by the indexing model from the issue text.
Description
bug: unguarded json.loads on streamed tool-call arguments crashes the request on empty/truncated JSON
Bug description
Providers occasionally stream empty or truncated tool-call argument JSON
(e.g. output cut off by token limits or an upstream hiccup). The unguarded
json.loads() on streamed arguments then raises JSONDecodeError, which
surfaces to the user as a raw error and aborts the in-flight step:
Error: Expecting value: line 1 column 1 (char 0)
This is provider-agnostic — any of the streaming providers can emit an empty
or truncated arguments payload.
Expected behavior
A malformed/empty streamed arguments payload should degrade gracefully, not
kill the request.
Suggested approach
Add a shared parse helper that:
- Parses strictly,
- Falls back to the existing lenient
extract_json()helper, - On total failure, raises a descriptive error naming the tool and including a payload snippet (instead of a bare JSONDecodeError).
Apply it to all streaming providers (Anthropic, OpenAI chat completions,
OpenAI Responses) and to Anthropic history replay, where a stale corrupt
payload in history should degrade to {} rather than breaking the current
request.
Environment
- Latest main
- Dominant language
- Python
- Stars
- 620
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-webui/computer
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-webui/computer#293 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-webui/computer#286 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-webui/computer#276 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-webui/computer#271 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/computer#269 · 1 comment ·
All issues in open-webui/computer
Similar issues
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NousResearch/hermes-agent#132042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EverMind-AI/Raven#845 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AstrBotDevs/AstrBot#10340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#20401 · 1 comment ·
Maintainers usually reply within 1 day