Commit 84df006
fix: abort with error in batch mode (--exit) when Ollama is unreachable
When Ollama returns a connection error during model info lookup, aider
previously treated it as a non-fatal warning and continued with "sane
defaults", opening the interactive TUI. In batch mode (--exit), this
causes the TUI output to be written to the redirected stdout instead of
aborting cleanly.
- ModelInfoManager.get_model_info: re-raise exceptions whose message
starts with "OllamaError:" instead of silently swallowing them
- Model.get_model_info: catch OllamaError, store on self.ollama_error,
return {} to allow interactive mode to continue with sane defaults
- main.py: if ollama_error is set and --exit is active, emit a clear
error message and return 1
Interactive mode is unaffected: the warning and sane-defaults behaviour
remain unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent bdb4d9f commit 84df006
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
890 | 897 | | |
891 | 898 | | |
892 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| |||
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
361 | 370 | | |
362 | 371 | | |
363 | 372 | | |
| |||
0 commit comments