Commit 388cc89
fix: improve error handling for Ollama JSON parsing errors (#87)
Enhances error handling and configurability for issue #87 where Ollama
returns malformed JSON causing RetryError failures.
Changes:
- Add specific detection and helpful error messages for Ollama unmarshal errors
- Provide actionable troubleshooting steps (restart Ollama, re-pull model, etc.)
- Add configurable maxRetries option to AIProviderConfig
- Pass maxRetries to AI SDK generateText and streamText calls
- Default maxRetries to 2 (same as AI SDK default)
This helps users understand that the issue is with their Ollama server,
not nanocoder, and gives them clear steps to resolve it.1 parent 3a2f87a commit 388cc89
2 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
27 | 45 | | |
28 | 46 | | |
29 | 47 | | |
| |||
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
| 159 | + | |
141 | 160 | | |
142 | 161 | | |
143 | 162 | | |
144 | 163 | | |
145 | 164 | | |
146 | 165 | | |
| 166 | + | |
| 167 | + | |
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
| |||
263 | 284 | | |
264 | 285 | | |
265 | 286 | | |
| 287 | + | |
266 | 288 | | |
267 | 289 | | |
268 | 290 | | |
| |||
384 | 406 | | |
385 | 407 | | |
386 | 408 | | |
| 409 | + | |
387 | 410 | | |
388 | 411 | | |
389 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
0 commit comments