Skip to content

[Bug]: Fallbacks does not work. Connection errors (ECONNREFUSED, network offline) should trigger model fallback to cloud providers #65810

Description

@mainguyenanhvu

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When the primary model provider (e.g., Ollama on localhost) becomes unreachable due to network issues (server offline, connection refused, network disconnected), OpenClaw does NOT trigger fallback to configured cloud backup models. This leaves the agent completely unresponsive instead of gracefully falling back to available cloud providers.

Steps to reproduce

  1. Configure OpenClaw with:
{
  "id": "main",
  "model": {
    "primary": "ollama/qwen3.5:27b",
    "fallbacks": ["github-copilot/gpt-4.1"]
  }
}
  1. Start OpenClaw and confirm it's using Ollama
  2. Turn off Ollama server (or disconnect network)
  3. Send a message to the agent
  4. Observe: Agent fails to respond, no fallback triggered

Expected behavior

When a primary model fails due to:

• Connection refused (ECONNREFUSED)
• Network unreachable (ENETUNREACH)
• Server offline
• DNS resolution failure
• Any network-level connection error

OpenClaw should automatically attempt fallback models in the configured chain, prioritizing cloud/remote providers when the failure is a local network issue.

Actual behavior

• Agent becomes completely unresponsive
• No fallback is attempted
• User receives generic error or silence
• System requires manual intervention (restart gateway, fix Ollama, etc.)

OpenClaw version

2026.3.28

Operating system

Windows 11

Install method

docker

Model

ollama/github-copilot

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

This breaks the core value proposition of model fallback:

• ❌ No high availability when it's most needed
• ❌ Manual intervention required for simple server restarts
• ❌ User experience degraded (agent appears broken)
• ❌ Fallback feature feels useless for its primary use case

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions