#Agents not using the model set in the openclaw.json config file

1 messages · Page 1 of 1 (latest)

analog temple
#

I was previously using a model for some of the agents, but after completing some tasks I changed the openclaw.json config file so these agents use another provider and model, but even after doing openclaw gateway restart the agents will keep using the model from the old config.

OpenClaw version is v2026.4.21
Operating System: Ubuntu 24.04.4 LTS
Kernel: Linux 6.17.0-20-generic
Architecture: x86-64

worn nestBOT
shell steppeBOT
#

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

worn nestBOT
uncut monolithBOT
#

Let me verify this against the docs/code so I don’t guess.

#

This is usually a persisted session model override, not the config being ignored.

Verified behavior:

  • agent config sets the default
  • channels.modelByChannel can pin a channel
  • /model or the Sessions UI sets a session override
  • that session override survives gateway restarts

So if you ever changed the model from chat or the UI, that old model can keep winning.

What to do:

  1. In the affected chat/thread, run /model and pick the agent’s current default again, or in Control UI set the session model to inherit/default.
  2. Check you do not also have channels.modelByChannel set for that channel.
  3. Inspect sessions:
    openclaw sessions --all-agents --json
    
#

If needed, check the session store under:
~/.openclaw/agents/<agentId>/sessions/sessions.json
and look for providerOverride / modelOverride.

Relevant docs:

If you paste:

  • the relevant agents.list[] block from openclaw.json
  • whether you used /model or the UI before
  • openclaw sessions --all-agents --json

…I can help pinpoint exactly which override layer is winning.

analog temple
#

I think these are keeping the configuration per channel instead of having one persistent configuration. Is there a way to make it persist?

uncut monolithBOT
#

Yep, that’s basically the behavior.

Model precedence is:

  1. session override (/model or Sessions UI)
  2. channel pin (channels.modelByChannel)
  3. agent default (agents.list[].model or agents.defaults.model)

So the config file does persist, but only as the default. It does not overwrite existing session state, even after openclaw gateway restart.

So if you want the new config to take over:

  • Single thread/chat: clear the session model override in the Sessions UI, set it back to inherit/default, or use /model and select the configured default again.
  • Many old sessions: you’ll need to clear the stored overrides in that agent’s session store, then restart.

What I’d check first:

#
openclaw sessions --all-agents --json

If you see old sessions still hanging around, that’s the likely source.

Also check whether you accidentally set:

channels: {
  modelByChannel: {
    ...
  }
}

That makes model choice persist per channel, but only when there isn’t already a session override.