mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
### What problem does this PR solve? Fixes four panic / spurious-error paths in the Go model layer. Closes #15818. | # | File | Bug | Fix | |---|------|-----|-----| | 1 | | Thinking-mode streaming path: accessed unconditionally; Gemini emits usage-only chunks with an empty slice, causing a runtime panic | Guard each step: , , before indexing | | 2 | | is a plain for ordinary requests; the cast to silently returns , then panics immediately | Switch on concrete type; handle both and | | 3 | | Identical panic on the streaming path | Same switch-on-type fix | | 4 | | The field is optional (absent for non-thinking models) but the code returned an error when it was missing, breaking every ordinary Ollama completion | Change to a silent comma-ok assertion; is empty string when the field is absent | ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>