#main agent keeps using openrouter/z-ai/glm-4.7, even though i didnt configure it?

1 messages · Page 1 of 1 (latest)

hallow ravine
#

I have a multi agent setup
"agents": {
"defaults": {
"model": {
"primary": "",
"fallbacks": [
""
]
},
"list": [
{
"id": "claw",
"workspace": "/home/herb/.openclaw/workspace-claw",
"model": {
"primary": "blt-gemini/gemini-3-flash-preview",
"fallbacks": [
"aifast-claude/claude-opus-4-5-20251101",
"blt-claude/claude-opus-4-6"
]
}
},
{
"id": "c0der",
"name": "c0der",
"workspace": "/home/herb/.openclaw/workspace-c0der",
"agentDir": "/home/herb/.openclaw/agents/c0der/agent",
"model": {
"primary": "lazyrouter/auto",
"fallbacks": []
}
},
{
"id": "aifred",
"workspace": "/home/herb/.openclaw/workspace-aifred",
"model": {
"primary": "lazyrouter/auto",
"fallbacks": [
"blt-gemini/gemini-3-flash-preview"
]
}
},
and these are all correctly working other than the claw (my first agent)

when i message to it it just says:

Claw, [16/02/2026 12:06]
✅ New session started · model: openrouter/z-ai/glm-4.7

Claw, [16/02/2026 12:06]
HTTP 401: User not found.

ocean jackalBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

marble inlet
#

try the "/new" command in chat. That starts a new session with the current primary model. Sessins stick to the model they were started with unless manually convinced to do otherwise, as sending the output of one model to another model labelled as its output can produce funny results.

hallow ravine
mellow cloakBOT
#

Yep — sessions are pinned to the model they were created with, so if that chat session was originally started when openrouter/z-ai/glm-4.7 was “winning” (via defaults/fallbacks), it’ll keep using it until you start a new one.

From the FAQ: send /new or /reset as a standalone message to force a fresh session:
https://docs.openclaw.ai/help/faq#how-do-i-start-a-fresh-conversation
(Concepts page: https://docs.openclaw.ai/concepts/session)

If it still starts a new session on openrouter/z-ai/glm-4.7, then it’s usually one of these:

  1. You’re not actually routed to the agent you think you are (multi-agent bindings pick the agent).
    Run: openclaw agents list --bindings and confirm that your Telegram/Discord peer is bound to agentId: "claw".
    Docs: https://docs.openclaw.ai/concepts/multi-agent

  2. Per-agent auth is missing, so your configured primary (blt-gemini/... / blt-claude/...) fails and it falls through to something else. Auth profiles are per-agent.
    Run: openclaw models status --agent claw (optionally --probe) and see what it thinks is available for that agent.
    Docs: https://docs.openclaw.ai/cli/models

Also: that HTTP 401: User not found is an OpenRouter auth failure (bad/missing key), so if you didn’t intend to use OpenRouter at all, it’s a strong sign you’re either (a) hitting fallbacks, or (b) routed to a different agent than expected.

#

If you paste:

  • openclaw --version
  • openclaw agents list --bindings
  • openclaw models status --agent claw (redacts secrets)


I can tell you exactly why it’s selecting that model.

marble inlet
#

shouldn't be a default. if it was openrouter/auto, yes, I could see that, but not glm 4.7. What does "/status" say? and on the commandline: "openclaw models" and "openclaw models list"?

mellow cloakBOT
#

It’s not a hardcoded default in OpenClaw. If you’re repeatedly seeing a new session start on openrouter/z-ai/glm-4.7, it’s almost always one of these:

  1. You’re not running the config you think you are (service is using a different config/state dir / profile), so your “real” default model is still OpenRouter.
    Run this and check whether Config (cli) vs Config (service) differ:
openclaw gateway status

If they differ, fix is:

openclaw gateway install --force

(from the same --profile / env you want the service to use)
Docs: https://docs.openclaw.ai/help/faq#why-does-openclaw-gateway-status-show-config-cli-and-config-service-different

  1. You’re routed to a different agent than you think (bindings), and that other agent has lazyrouter/auto / OpenRouter as default/fallback.
    Check:
#
openclaw agents list --bindings
  1. Your configured model for that agent is failing, so it falls through to a fallback that ultimately resolves to OpenRouter. (Also remember: auth is per-agent; “claw” doesn’t automatically share creds with other agents.)
    Check the agent’s resolved model + auth state:
openclaw models status --agent claw

Fastest single thing to paste from the chat where it happens: send /model status in that same conversation. It prints which agent is active, what model is selected, and which auth/profile file it’s using.

If you paste:

  • openclaw --version
  • openclaw gateway status
  • /model status output from the affected chat
#


I can tell you exactly where that OpenRouter model is coming from.

hallow ravine
#
:lobster: OpenClaw 2026.2.15 (3fe22ea) — End-to-end encrypted, drama-to-drama excluded.

Agents:
- claw (default)
  Identity: :wave: claw (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-claw
  Agent dir: ~/.openclaw/agents/claw/agent
  Model: blt-gemini/gemini-3-flash-preview
  Routing rules: 1
  Routing: default (no explicit rules)
  Routing rules:
    - telegram accountId=claw
- c0der
  Identity: Rotate naturally: :joy_cat: (ironic/funny), :saluting_face: (ack), :skull: (relatable), :pinched_fingers: (perfect), :brain: (clever). Don't overuse—let them fit the moment. Source: herb's 2026-02-10 prefs (memory/2026-02-10-2039.md#L23). c0der (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-c0der
  Agent dir: ~/.openclaw/agents/c0der/agent
  Model: lazyrouter/auto
  Routing rules: 1
  Routing rules:
    - telegram accountId=c0der
- aifred
  Identity: :tophat: AIfred (aka Butler) (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-aifred
  Agent dir: ~/.openclaw/agents/aifred/agent
  Model: lazyrouter/auto
  Routing rules: 1
  Routing rules:
    - telegram accountId=aifred
- lunaaaa
  Identity: Luna (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-lunaaaa
  Agent dir: ~/.openclaw/agents/lunaaaa/agent
  Model: blt-gemini/gemini-3-flash-preview
  Routing rules: 1
  Routing rules:
    - telegram accountId=lunaaaa
- worbot
  Identity: :brain: openclaw (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-worbot
  Agent dir: ~/.openclaw/agents/worbot/agent
  Model: blt-claude/claude-opus-4-6
  Routing rules: 1
  Routing rules:
    - telegram accountId=worbot
- main
  Workspace: ~/.openclaw/workspace-main
  Agent dir: ~/.openclaw/agents/main/agent
  Routing rules: 0

#

🩞 OpenClaw 2026.2.15 (3fe22ea) — Your task has been queued; your dignity has been deprecated.

Config        : ~/.openclaw/openclaw.json
Agent dir     : ~/.openclaw/agents/claw/agent
Default (agent): blt-gemini/gemini-3-flash-preview
Fallbacks (2) (agent): aifast-claude/claude-opus-4-5-20251101, blt-claude/claude-opus-4-6
Image model (defaults): -
Image fallbacks (0) (defaults): -
Aliases (0)   : -
Configured models (0): all

Auth overview
Auth store    : ~/.openclaw/agents/claw/agent/auth-profiles.json
Shell env     : off
Providers w/ OAuth/tokens (2): google-gemini-cli (1), openai-codex (1)
- aifast effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | aifast:default=sk-qj438...qt5zMcvR
- blt-claude effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | blt-claude:default=redacted
- blt-gemini effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | blt-gemini:redacted
mellow cloakBOT
#

Yeah, openrouter/z-ai/glm-4.7 shouldn’t just appear out of thin air as a “code default”. When I see that exact combo plus HTTP 401: User not found, it usually means:

  • you do have some OpenRouter credentials present somewhere (but they’re wrong/invalid), and
  • the chat is being routed to an agent (or fallback path) that ends up using OpenRouter.

A few very targeted checks will tell us where it’s coming from:

1) In the affected chat, run:

  • /model status ← most useful (shows active agent + model + auth/profile source)
  • /status ← also fine, but /model status is the one that tends to expose the “why”

Paste the output.

2) On the host (CLI), run:

openclaw --version
#
openclaw agents list --bindings
openclaw models status --agent claw --probe
openclaw models status --agent c0der --probe
openclaw gateway status

What we’re looking for:

  • bindings: are messages actually hitting agentId: claw? If they accidentally route to c0der, note c0der is set to lazyrouter/auto in your snippet — that kind of router can absolutely choose something like GLM 4.7.
  • models status (per-agent): does the claw agent have working auth for blt-gemini / blt-claude? If those can’t auth, it will fail over.
  • gateway status: check Config (cli) vs Config (service) mismatch (super common). If they differ, the service is running a different config than the one you edited.

3) Quick sanity: your config snippet shows

agents.defaults.model.primary is "" (empty). Even if per-agent models are set, I’d still fix that to something explicit, because “empty default” can lead to surprising fallback behavior in some setups.

If you paste the outputs from (1) + (2), we can pinpoint whether this is (a) routing to the wrong agent, (b) per-agent auth missing so it falls through, or (c) service running a different config/profile than you think.

marble inlet
#

after that "/status", you can try "/model blt-gemini/gemini-3-flash-preview" to manually switch to your preferred model. Take note of the message you get: If it says "(default)" after the model name, then all is fine and the session just got wired weirdly. if not, then something has to be fixed

hallow ravine
# marble inlet after that "/status", you can try "/model blt-gemini/gemini-3-flash-preview" to ...

Claw, [16/02/2026 12:41]
🩞 OpenClaw 2026.1.30 (76b5208)
🧠 Model: openrouter/z-ai/glm-4.7 · 🔑 api-key sk-or-
9b5217 (openrouter:default)
📚 Context: 0/203k (0%) · đŸ§č Compactions: 0
đŸ§” Session: agent:main:main ‱ updated just now
⚙ Runtime: direct · Think: low
đŸȘą Queue: collect (depth 0)

Telepathic Herb, [16/02/2026 12:41]
/model blt-gemini/gemini-3-flash-preview

Claw, [16/02/2026 12:41]
Model reset to default (blt-gemini/gemini-3-flash-preview).

Telepathic Herb, [16/02/2026 12:41]
hi

Claw, [16/02/2026 12:41]
HTTP 401: User not found.

Telepathic Herb, [16/02/2026 12:42]
/new

Claw, [16/02/2026 12:42]
✅ New session started · model: openrouter/z-ai/glm-4.7

Claw, [16/02/2026 12:42]
HTTP 401: User not found.

thought i had it fixed.

marble inlet
#

ok, it says "Model: blt-gemini/gemini-3-flash-preview" in that printout. So it seems it's just the current session that's wired wrong. Chnaging the model manually as I showed above should work and stick

mellow cloakBOT
#

That status output is actually really useful: it shows the configured model for agent claw is blt-gemini/gemini-3-flash-preview, and routing for Telegram accountId=claw goes to that agent.

So if your chat still starts a new session on openrouter/z-ai/glm-4.7, it’s almost certainly not “a default in the code” — it’s one of these mismatches:

1) The chat is hitting a different running Gateway/config than the one you’re inspecting

Run and paste:

openclaw gateway status

Check whether Config (cli) and Config (service) match. If they don’t, you’re editing one config while the service runs another. (Fix is usually openclaw gateway install --force from the right profile/env.)

2) The chat has a pinned per-session model override

In the affected chat, send:

  • /model status

This will tell us if the session is “pinned” to OpenRouter (even across /new).

#

3) You’re accidentally talking to a different agent/bot account than you think

Even if the bot is named “Claw” in the app, the real proof is the routing decision + agent id shown by /model status (and/or gateway logs).


If you can paste these two things, we can pinpoint it quickly:

  1. openclaw gateway status
  2. /model status from the chat that shows openrouter/z-ai/glm-4.7

(And don’t paste any tokens/keys—just the status output.)

marble inlet
#

Am I blind or do you really have no agent marked with "default": true,? That could be an issue, considering your default is empty.

hallow ravine
mellow cloakBOT
#

That output is a great clue: your config for agent claw is not set to OpenRouter at all. It’s clearly:

  • Default (agent): blt-gemini/gemini-3-flash-preview
  • Fallbacks: aifast-claude/..., blt-claude/...
  • And there’s no OpenRouter provider/auth shown in the auth overview.

So if Telegram still prints:

✅ New session started · model: openrouter/z-ai/glm-4.7


then one of these must be true:

A) You’re not talking to the agent you think you are (routing mismatch)

In the Telegram chat that shows the GLM model, send as a standalone message:

  • /model status
#

Paste that output. It will explicitly say which agentId is active for that chat. If it’s actually hitting c0der/aifred (both lazyrouter/auto), then OpenRouter/GLM makes sense.

B) The Gateway service is running a different config than the CLI is reading

Run and paste:

openclaw gateway status

If it shows Config (cli) and Config (service) differ, you’re editing ~/.openclaw/openclaw.json but the daemon is running another profile/state dir. The FAQ fix is:

openclaw gateway install --force

(from the same profile/env you want the service to use)

#

Docs: https://docs.openclaw.ai/help/faq#why-does-openclaw-gateway-status-show-config-cli-and-config-service-different

C) That Telegram chat has a model override pinned

This will also show up in /model status.

To forcibly “prove it” either way, in that Telegram chat try one of these:

  • /new blt-gemini/gemini-3-flash-preview
  • or /model blt-gemini/gemini-3-flash-preview

(/new <model> is supported per the session docs.)


One more oddity in your pasted models status output:
it says your claw agent’s auth store is ~/.openclaw/agents/claw/agent/auth-profiles.json, but the effective keys for blt-gemini / blt-claude / aifast are coming from ~/.openclaw/agents/main/agent/auth-profiles.json.

#

That’s not directly causing OpenRouter, but it’s a sign auth is “bleeding across agents” (or you’ve got some shared/legacy path situation). After we confirm A/B/C above, we should clean that up so each agent is truly isolated.

If you paste (1) /model status from the problem chat and (2) openclaw gateway status, we can tell exactly which branch you’re in.

marble inlet
#

I'd guess "C". The /model command shows that you switched to the default model, but /new sets another one. That smells like an override for the session or channel

mellow cloakBOT
#

That pasted Telegram /status is the smoking gun:

  • It says OpenClaw 2026.1.30 and Session: agent:main:main
  • Model is openrouter/z-ai/glm-4.7 with an OpenRouter key (openrouter:default)
  • But your CLI output earlier was OpenClaw 2026.2.15 with default agent claw and default model blt-gemini/gemini-3-flash-preview

Those cannot be the same running gateway/config. You’re effectively talking to a different OpenClaw instance (or the daemon is running a different profile/config) when you DM on Telegram — one where main is the agent and OpenRouter is configured.

Why /new keeps going back to GLM: /new resets to the agent’s configured default for the agent that chat is routed to. In your Telegram chat you’re routed to agent:main, so it keeps restarting on that main agent’s OpenRouter default.

What to do next (2 quick checks)

  1. On the machine that’s actually running the Telegram bot, run:
openclaw gateway status

and confirm Config (cli) vs Config (service) match. If they don’t, you’re editing one config but the service runs another. (FAQ fix is openclaw gateway install --force from the right profile/env.)

#
  1. Also run:
openclaw models status --agent main
openclaw models status --agent claw

I expect --agent main will show the OpenRouter default you’re seeing in Telegram.

If you paste the output of openclaw gateway status (the part showing config paths) I can tell you exactly where the “old” instance/config is coming from and how to get Telegram routed to the claw agent.

hallow ravine
marble inlet
#

yes, it seems you had a faux "main" agent because you had no default set for those configured ones

mellow cloakBOT
#

Yeah, it smells like an override at first glance — but the /status you pasted basically proves it’s not a “weird session wiring” thing:

  • Telegram /status says OpenClaw 2026.1.30 and Session: agent:main:main
  • Your CLI output earlier says OpenClaw 2026.2.15 and shows your intended agent is claw with default blt-gemini/gemini-3-flash-preview

So /new in Telegram is resetting correctly
 just resetting the wrong agent / wrong gateway instance (the one where main defaults to OpenRouter/GLM).

What I’d do next:

  1. On the machine actually running the Telegram bot, paste:
openclaw gateway status

Look specifically for Config (cli) vs Config (service) mismatching (very common when the service was installed under a different profile/env/path).

If they differ, fix is:

#
openclaw gateway install --force
openclaw gateway restart

Docs: https://docs.openclaw.ai/help/faq#why-does-openclaw-gateway-status-show-config-cli-and-config-service-different

  1. Also run (same machine):
openclaw models status --agent main
openclaw models status --agent claw

I expect --agent main will show the OpenRouter default + key that your Telegram /status is showing.

Once Telegram is actually routed to the claw agent (or the service is using the right config), /new will start on blt-gemini/... as expected.

If you paste openclaw gateway status, we can tell immediately whether this is a “service running different config” situation or “two gateways running” situation.

#

Adding "default": true to claw is a good cleanup (it removes ambiguity if bindings ever don’t match), but it won’t explain what you’re seeing in Telegram.

The key detail from your Telegram /status paste is:

  • OpenClaw 2026.1.30 (old)
  • Session: agent:main:main
  • Model: openrouter/z-ai/glm-4.7


but your CLI status earlier shows OpenClaw 2026.2.15 and claw (default) with blt-gemini/....

That means your Telegram bot is currently being served by a different running gateway instance / different service config than the one you’re inspecting with the CLI.

What to do (in this order):

  1. On the host that runs the Telegram bot, run:
#
openclaw gateway status

If it shows Config (cli) and Config (service) don’t match, fix with:

openclaw gateway install --force
openclaw gateway restart

(Docs: https://docs.openclaw.ai/help/faq#why-does-openclaw-gateway-status-show-config-cli-and-config-service-different)

  1. Verify you don’t have two gateways fighting over the same Telegram token (only one will “win” long-polling). After the restart, re-run /status in Telegram — it should now show 2026.2.15 and the session key should be under agent:claw:..., not agent:main:main.

  2. Then add the default flag (if you want):

agents: {
  list: [
#
    { id: "claw", default: true, ... }
  ]
}

/model blt-gemini/... “working” is consistent with this: you can override within the currently-running (wrong) gateway/session, but /new will always snap back to that gateway’s agent default — which right now is clearly main + OpenRouter.

ocean jackalBOT