Skip to content

fix: multi-host fallback integration and accurate health status#3

Merged
dayanstef merged 1 commit intomainfrom
fix/multi-host-falback
Feb 5, 2026
Merged

fix: multi-host fallback integration and accurate health status#3
dayanstef merged 1 commit intomainfrom
fix/multi-host-falback

Conversation

@dayanstef
Copy link
Copy Markdown
Member

Fixes:

  • Multi-host fallback now works in main chat loop
  • Accurate host health status display in /hosts command
  • Clear user feedback when fallback occurs or fails

Changes:

  • internal/assistant/assistant.go: Add hostPool field, SetHostPool(), switchToFallbackProvider(), isHostRetryableError()
  • internal/provider/hostpool.go: Verify connectivity before marking healthy
  • cmd/repl.go: Wire HostPool to Assistant after initialization

The HostPool was not connected to the Assistant, so automatic fallback never triggered during chat. Now when primary host fails, the system automatically switches to a healthy fallback host and notifies the user.

Additionally, hosts were incorrectly marked healthy before actual connectivity verification. Now DetectModels() must succeed before a host is considered healthy.

Description

Brief description of what this PR does.

Related Issue

Fixes #(issue number) or Related to #(issue number)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

How Has This Been Tested?

Describe the tests you ran:

  • Tested locally with Ollama
  • Added/updated unit tests
  • Tested on macOS
  • Tested on Linux

Checklist

  • My code follows the project style guidelines
  • I have performed a self-review of my code
  • gofmt -s -l . shows no files (code is formatted)
  • go vet ./... passes
  • make test passes
  • make build succeeds
  • I have updated documentation if needed
  • My changes generate no new warnings

Fixes:
- Multi-host fallback now works in main chat loop
- Accurate host health status display in /hosts command
- Clear user feedback when fallback occurs or fails

Changes:
- internal/assistant/assistant.go: Add hostPool field, SetHostPool(),
switchToFallbackProvider(), isHostRetryableError()
- internal/provider/hostpool.go: Verify connectivity before marking healthy
- cmd/repl.go: Wire HostPool to Assistant after initialization

The HostPool was not connected to the Assistant, so automatic fallback
never triggered during chat. Now when primary host fails, the system
automatically switches to a healthy fallback host and notifies the user.

Additionally, hosts were incorrectly marked healthy before actual
connectivity verification. Now DetectModels() must succeed before
a host is considered healthy.
@dayanstef dayanstef self-assigned this Feb 5, 2026
@dayanstef dayanstef merged commit ff1b38b into main Feb 5, 2026
4 checks passed
@dayanstef dayanstef deleted the fix/multi-host-falback branch February 5, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant