[loop-cycle-6] fix: Ollama disconnect logging and error handling (#92) #96

Merged
hermes merged 1 commits from fix/ollama-disconnect-logging into main 2026-03-14 18:41:28 -04:00
Collaborator

What

Add specific error handling for Ollama disconnections across the codebase.

Changes

  • agents/base.py: BaseAgent.run() now catches httpx.ConnectError, httpx.ReadError, ConnectionError — logs "Ollama disconnected" at ERROR level and re-raises (no silent swallowing)
  • session.py: chat(), chat_with_tools(), continue_chat() distinguish Ollama connection errors from general failures — return specific "Ollama appears to be disconnected" message
  • 11 new tests covering all disconnect paths in both BaseAgent and session layer

Acceptance Criteria

  • Disconnected Ollama produces "Ollama disconnected" error log
  • Processing halts with clear error messages
  • Non-Ollama errors unchanged

Stats

  • +329/-2 lines (304 are tests)
  • 991 tests passing (1 pre-existing shell test env issue)

Closes #92

## What Add specific error handling for Ollama disconnections across the codebase. ## Changes - **agents/base.py**: `BaseAgent.run()` now catches `httpx.ConnectError`, `httpx.ReadError`, `ConnectionError` — logs "Ollama disconnected" at ERROR level and re-raises (no silent swallowing) - **session.py**: `chat()`, `chat_with_tools()`, `continue_chat()` distinguish Ollama connection errors from general failures — return specific "Ollama appears to be disconnected" message - **11 new tests** covering all disconnect paths in both BaseAgent and session layer ## Acceptance Criteria - [x] Disconnected Ollama produces "Ollama disconnected" error log - [x] Processing halts with clear error messages - [x] Non-Ollama errors unchanged ## Stats - +329/-2 lines (304 are tests) - 991 tests passing (1 pre-existing shell test env issue) Closes #92
hermes added 1 commit 2026-03-14 18:41:08 -04:00
fix: log Ollama disconnections with specific error handling (#92)
All checks were successful
Tests / lint (pull_request) Successful in 5s
Tests / test (pull_request) Successful in 1m4s
bce6e7d030
- BaseAgent.run(): catch httpx.ConnectError/ReadError/ConnectionError,
  log 'Ollama disconnected: <error>' at ERROR level, then re-raise
- session.py: distinguish Ollama disconnects from other errors in
  chat(), chat_with_tools(), continue_chat() — return specific message
  'Ollama appears to be disconnected' instead of generic error
- 11 new tests covering all disconnect paths
hermes merged commit b01c1cb582 into main 2026-03-14 18:41:28 -04:00
Sign in to join this conversation.