JPette1783
e050f1816e
fix(models): guard unsafe index access in Google and Ollama drivers ( #15819 )
...
### 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 >
2026-06-09 19:26:52 +08:00
..
2026-05-28 13:33:01 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-05-18 12:03:33 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-05-21 15:32:49 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-05 13:26:32 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-04 17:50:22 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 19:32:19 +08:00
2026-06-08 19:32:19 +08:00
2026-05-26 10:52:09 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 13:09:36 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:26:52 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-04 17:50:22 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-05-29 10:09:27 +08:00
2026-06-09 19:01:00 +08:00
2026-05-18 12:03:12 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-05-29 19:34:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 19:32:01 +08:00
2026-06-09 19:01:00 +08:00
2026-06-03 19:16:28 +08:00
2026-06-09 19:01:00 +08:00
2026-06-03 19:16:28 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 19:27:19 +08:00
2026-06-09 19:01:00 +08:00
2026-06-02 13:40:10 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-05-11 17:21:16 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:26:52 +08:00
2026-05-25 10:25:53 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-05-21 15:33:02 +08:00
2026-06-09 19:01:00 +08:00
2026-06-04 17:50:22 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 13:32:52 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 13:10:10 +08:00
2026-06-09 19:01:00 +08:00
2026-06-02 15:27:26 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-05-22 15:21:45 +08:00
2026-06-09 19:01:00 +08:00
2026-06-09 19:01:00 +08:00
2026-05-21 15:33:21 +08:00
2026-06-09 19:01:00 +08:00
2026-05-15 13:27:22 +08:00
2026-06-09 19:01:00 +08:00
2026-05-27 13:14:56 +08:00
2026-06-09 19:01:00 +08:00
2026-05-29 19:34:00 +08:00
2026-06-09 19:01:00 +08:00
2026-05-26 19:58:20 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 21:11:21 +08:00
2026-06-09 19:01:00 +08:00
2026-06-08 20:06:57 +08:00
2026-06-09 19:01:00 +08:00
2026-06-03 19:16:28 +08:00
2026-06-09 19:01:00 +08:00
2026-05-22 11:53:18 +08:00
2026-05-26 10:50:06 +08:00
2026-06-09 19:01:00 +08:00