bug: unguarded json.loads on streamed tool-call arguments crashes the request on empty/truncated JSON
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Individua l’helper condiviso extract_json() e i percorsi di analisi degli argomenti in streaming per Anthropic, OpenAI chat completions, OpenAI Responses e la riproduzione della cronologia Anthropic. Traccia il modo in cui i payload vuoti o troncati raggiungono attualmente json.loads(), quindi verifica che un input di streaming non valido produca un errore descrittivo specifico dello strumento e che una cronologia corrotta venga degradata a {} senza interrompere la richiesta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 667
- Fork
- 96
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-webui/computer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-webui/computer#314 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-webui/computer#293 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-webui/computer#286 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-webui/computer#276 · 1 commento · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-webui/computer#271 ·
Tutte le issue di open-webui/computer
Issue simili
-
`burr` fails to start when the Python path has a space in itForse già presa @enekoreto l’ha presa oggi. Apertastatus/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
gemini 出现了新的域名需要加入Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
debpalash/VoiceStudio#2903 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dagster-io/community-integrations#367 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
aws-samples/sample-per-model-bedrock#243 ·
I maintainer di solito rispondono entro 1 giorno