Skip to content

[Bug]: Ollama local model + Telegram: “No API key found for provider ollama” and CLI “pairing required” on 2026.2.19-2 #22055

Description

@septembershen

Summary

OpenClaw 2026.2.19-2 cannot reliably use a local Ollama model as the primary provider: Telegram reports “No API key found for provider ollama” and the CLI reports “gateway pairing required” even though Ollama is configured and authenticated.

Steps to reproduce

  1. On Linux Mint (Yoga X1, i7‑7500U, 8 GB RAM), install OpenClaw via npm:
    npm install -g openclaw@latest

  2. Install and run Ollama locally, pull llama3.1:8b, verify with ollama list.

  3. Set export OLLAMA_API_KEY="ollama-local" and restart the shell.

  4. Run openclaw onboard --install-daemon and complete the onboarding wizard, choosing any cloud provider during Quickstart.

  5. Set the primary model to the local Ollama model:
    openclaw config set agents.defaults.model.primary "ollama/llama3.1:8b".

  6. Confirm the model appears as local and authenticated: openclaw models list shows ollama/llama3.1:8b with local yes auth yes.

  7. Create ~/.openclaw/agents/main/agent/auth-profiles.json with:

json
{
"ollama:local": {
"type": "token",
"provider": "ollama",
"token": "ollama-local"
},
"lastGood": {
"ollama": "ollama:local"
}
}
then run openclaw gateway restart.

  1. Connect a Telegram bot via the Web UI (bot: @SeptemberTBot) and approve the Telegram user pairing when prompted.

  2. In the Web UI chat, send test with local llama.

  3. In Telegram, send a message to @SeptemberTBot.

  4. From the CLI, run openclaw logs --follow and openclaw status.

Expected behavior

  • Web UI chat requests using the main agent should successfully call ollama/llama3.1:8b and return responses.

  • Telegram messages to @SeptemberTBot should route through the main agent and return responses using the local model, without auth errors.

  • openclaw models list showing auth yes for ollama/llama3.1:8b should be sufficient for the main agent to use that provider once an auth profile exists.

  • openclaw status and openclaw logs --follow should connect to the local gateway without “pairing required” errors after openclaw onboard --install-daemon successfully completes.

Actual behavior

Web UI:

  • Sending a simple message such as test with local llama in the Web UI chat hangs indefinitely; no reply is returned.

Telegram (@SeptemberTBot):

  • Messages return:
    Agent failed before reply: No API key found for provider "ollama". Auth store: /home/linux/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/linux/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add ) or copy auth-profiles.json from the main agentDir. Logs: openclaw logs --follow

  • This happens even though openclaw models list shows ollama/llama3.1:8b with local yes auth yes and auth-profiles.json contains the ollama:local profile and lastGood.ollama mapping as above.

CLI status/logs:

  • openclaw status and openclaw logs --follow consistently show:
    gateway connect failed: Error: pairing required
    [openclaw] Failed to start CLI: Error: gateway closed (1008): pairing required
    Gateway target: ws://127.0.0.1:18789
    Source: local loopback
    Config: /home/linux/.openclaw/openclaw.json
    Bind: loopback
    Hint: run 'openclaw doctor'

  • This persists even after running openclaw onboard --install-daemon and after multiple restarts.

OpenClaw version

CLI: 2026.2.19-2

Operating system

OS: Linux Mint (Cinnamon) [please add exact version, e.g. 22 or 21.3] Hardware: Lenovo Yoga X1 Gen 2, Intel i7‑7500U @ 2.7 GHz, 8 GB RAM, 64‑bit

Install method

Installed globally via npm: npm install -g openclaw@latest

Logs, screenshots, and evidence

openclaw models list (relevant line):

text
MODEL                 PROVIDER  LOCAL  AUTH
ollama/llama3.1:8b    ollama    yes    yes

Ollama:

bash
ollama list
# Output:
# NAME           ID            SIZE   MODIFIED
# llama3.1:8b    46e0c10c039e  4.9GB  [~3 hours ago]
CLI status / logs:

text
openclaw status

Gateway is unreachable (connect failed: pairing required)
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/linux/.openclaw/openclaw.json
Bind: loopback
Hint: run 'openclaw doctor'


openclaw logs --follow

gateway connect failed: Error: pairing required
[openclaw] Failed to start CLI: Error: gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /home/linux/.openclaw/openclaw.json
Bind: loopback
Hint: run 'openclaw doctor'
Telegram error (user-visible, from @SeptemberTBot):

text
Agent failed before reply: No API key found for provider "ollama".
Auth store: /home/linux/.openclaw/agents/main/agent/auth-profiles.json
(agentDir: /home/linux/.openclaw/agents/main/agent).
Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir.
Logs: openclaw logs --follow
Auth store file content:

json
{
  "ollama:local": {
    "type": "token",
    "provider": "ollama",
    "token": "ollama-local"
  },
  "lastGood": {
    "ollama": "ollama:local"
  }
}

Impact and severity

Who is affected: users trying to use OpenClaw 2026.2.19‑2 with a local Ollama model as the primary provider, including Telegram and Web UI agents.

Severity: medium–high for this configuration:

The local Ollama model is detected (local yes auth yes), but the main agent cannot actually use it.

Telegram and Web UI both effectively cannot respond using the configured local model.

Frequency: 100% reproducible on my environment following the steps above (fresh install, clean ~/.openclaw, latest CLI).

Practical consequences:

Local Ollama cannot be used for real conversations despite being correctly configured and authenticated.

CLI diagnostics (status, logs --follow) are blocked by persistent “pairing required” even after onboard --install-daemon, making troubleshooting difficult.

Telegram bot remains unusable with the local model, always failing before reply with the “No API key found for provider ollama” message.

Additional information

I originally had a slightly older CLI and some partial config changes (manual config set commands for Ollama). After issues, I:

Renamed /.openclaw to a timestamped backup (/.openclaw.backup.).

Reinstalled and re‑onboarded with openclaw onboard --install-daemon.

Re‑configured Ollama from scratch as described above.

Even after this clean reset and upgrade to 2026.2.19‑2, the combination of:

models list showing auth yes for ollama/llama3.1:8b,

A valid auth-profiles.json with ollama:local and lastGood.ollama, and

A correctly set agents.defaults.model.primary
still results in:

Telegram claiming “No API key found for provider ollama” for the main agent, and

The CLI reporting the gateway as “pairing required”.

It feels like there may be a mismatch between:

Provider-level auth state (models list),

Agent-level auth profiles, and

The device/gateway pairing state for this CLI instance.

Happy to run any extra debug commands (openclaw doctor, extra env dumps, etc.) and attach results.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions