#Multi-gateway chats
1 messages · Page 1 of 1 (latest)
If you have multiple OpenClaw bots / gateways in the same Discord channel, “overtalking” is basically inevitable unless you gate them hard. And “loops” usually means you accidentally allowed bots to read other bot messages.
1) Stop bot-to-bot loops (most common fix)
In Discord, OpenClaw ignores bot-authored messages by default. Loops usually happen when you turned that back on via allowBots.
Make sure your guild/channel does not have allowBots: true. If you need to allow some bot messages, set it to mentions-only:
{
channels: {
discord: {
guilds: {
YOUR_SERVER_ID: {
allowBots: "mentions", // or just remove it (default is: bots ignored)
requireMention: true
}
}
}
}
}
Docs: https://docs.openclaw.ai/gateway/configuration-reference (see allowBots) and https://docs.openclaw.ai/channels/discord (mentions + gating)
2) Prevent “multiple bots answering the same user message”
If you’re running 2+ bots in one channel, set requireMention: true for all of them, then only mention the one you actually want to answer. Otherwise they’ll all respond to every message (even if they don’t loop with each other).
3) Stop “looping useless messages” mid-run
In chat, send stop or abort as a standalone message (no slash). That hard-interrupts the current run.
Docs: https://docs.openclaw.ai/help/faq#how-do-i-stopcancel-a-running-task
Also check your queue mode (/queue) if it feels like it’s talking over itself (multiple messages while a run is in-flight). The FAQ lists modes like collect / followup / interrupt.
Docs: https://docs.openclaw.ai/help/faq#why-does-it-feel-like-the-bot-ignores-rapidfire-messages
4) Keep context from ballooning (cost + “stale context”)
- Use
/compactbefore a long task (summarizes older history) - Use
/newwhen switching topics (fresh session)
Docs: https://docs.openclaw.ai/concepts/compaction and https://docs.openclaw.ai/help/faq#im-getting-context-too-large-errors---how-do-i-reset-or-compact
If the bloat is mostly tool output, enable session pruning:
Docs: https://docs.openclaw.ai/concepts/session-pruning
If you paste:
openclaw --version- the relevant
channels.discord.guilds.YOUR_SERVER_IDconfig block (redact tokens)
…and tell me how many gateways/bots are connected to this channel, I can point to the exact knob that’s causing the overtalk/loops.
how i can make them auto compact
and how I can make them auto /new if they figure out that it is not related to new discussion
Auto-compaction is already on by default — it kicks in when the session is getting close to the model’s context limit.
If you want it to compact earlier / more proactively, set agents.defaults.compaction in your config (JSON5) and increase the reserved token floor.
Config file location (default): ~/.openclaw/openclaw.json
Docs: https://docs.openclaw.ai/help/faq#what-format-is-the-config-where-is-it
Example:
{
agents: {
defaults: {
compaction: {
mode: "safeguard", // safer for long histories
reserveTokensFloor: 24000, // bump this up to compact earlier
memoryFlush: { enabled: true } // optional (extra turn before compaction)
}
}
}
}
Notes:
- Higher
reserveTokensFloor=> keeps more headroom => compacts sooner (helps avoid “context too large”). - You can still force it anytime with
/compact. - If the main bloat is tool output, also enable session pruning (
agents.defaults.contextPruning) — that trims old tool results without rewriting history: https://docs.openclaw.ai/concepts/session-pruning
Config reference + compaction details:
There isn’t a built-in “semantic topic change detector” that will automatically /new just because the model thinks your message is unrelated. That’s intentionally not automatic (it’d reset at the wrong time and be super annoying).
What you can do is make sessions auto-reset based on time, which is basically “auto /new after inactivity”:
Option A) Auto-new after N minutes idle (recommended)
Set an idle reset policy in ~/.openclaw/openclaw.json:
{
session: {
reset: { mode: "idle", idleMinutes: 30 } // after 30m idle, next message starts a fresh session
}
}
If you want it only for group/channel chats (Discord channels) but keep DMs long-lived:
{
session: {
resetByType: {
group: { mode: "idle", idleMinutes: 30 },
direct: { mode: "idle", idleMinutes: 240 }
}
}
}
Docs: https://docs.openclaw.ai/concepts/session and https://docs.openclaw.ai/gateway/configuration-reference#session
Option B) Use Discord threads/channels as “new topic = new context”
On Discord, each channel is already its own session key, and threads can be isolated too — so the clean workflow is: new topic → new thread (or a dedicated channel per bot/topic). That avoids mixing context without relying on the model to guess.
Manual fallback
When you know it’s a new topic: /new (or /reset) + optionally /compact before switching.
(If you tell me whether this is happening in DMs vs a guild channel vs a thread, I can suggest the best resetByType setup.)
I want bots to keep chatting with each other in mentions within themselves until task I've given is done
You can do that, but you need to set it up so it’s intentional + bounded, otherwise you get the exact “looping/overtalking” pain you started with.
Recommended way (supported): sub-agents (bots “chat internally”, you get results)
Have one “coordinator” bot in the channel, and let it spawn workers via sub-agents. They’ll collaborate in the background and announce back when done.
Docs: https://docs.openclaw.ai/tools/subagents and https://docs.openclaw.ai/concepts/multi-agent
This avoids Discord bot-to-bot message storms entirely.
If you really want visible bot-to-bot chatting in Discord mentions
1) Allow bot-authored messages only when mentioned
Set Discord to accept bot messages only when they @mention the bot (prevents accidental loops):
{
channels: {
discord: {
guilds: {
YOUR_SERVER_ID: {
requireMention: true,
allowBots: "mentions" // key part
}
}
}
}
}
(Without this, bots won’t “hear” each other at all, or they’ll hear everything and spiral.)
Docs: https://docs.openclaw.ai/gateway/configuration-reference (see allowBots) and https://docs.openclaw.ai/channels/discord
2) Give them a strict “handoff protocol”
In each bot’s AGENTS.md (per-agent workspace), add rules like:
- “Only respond when explicitly mentioned.”
- “When you reply, mention the next bot only if you need another step.”
- “When finished, reply with
DONE:and do not mention any bot again.” - “Never repeat the same request twice; if stuck, ask the human.”
That “stop mentioning” rule is what actually ends the loop when the task is done.
3) Put this in a dedicated channel/thread
Do it in a dedicated #bot-lab style channel so normal chat doesn’t trigger it.
If you tell me your setup (one gateway with multiple agents? or multiple separate gateways each with its own Discord bot token?), I can point to the exact place to put allowBots: "mentions" and the cleanest coordinator/worker pattern.
Here are some high-leverage instructions to put in each bot’s AGENTS.md so you get collaboration without runaway loops / context bloat.
“Global” rules (put on every bot)
- Mention gate + bot gate
- “Only respond when @mentioned by the human or the coordinator bot.”
- “Ignore messages from other bots unless they @mention you.”
- Hard stop conditions (prevents infinite ping‑pong)
- “Never do more than 2 replies in a row to another bot without new info.”
- “If you’re stuck after 2 turns, ask the human one clear question and stop.”
- Context hygiene (token saver)
- “Do not restate the full conversation. Keep replies under ~10 lines unless asked.”
- “If you must keep state, write a short checkpoint as
STATE.md(or similar) and then refer to it instead of repeating.”
- Anti-noise
- “If you have nothing new to add, reply with a single line:
NO_UPDATE.”
- No big pastes
- “Never paste long logs. Quote only the 3–10 most relevant lines + what they imply.”
Coordinator bot instructions (the “manager”)
- “When the human gives a task, split into subtasks and assign each to a specific worker.”
- “Use a task ID per subtask:
T1,T2, …” - “Workers only talk to the coordinator (not to each other) unless explicitly told.”
- “Only the coordinator posts the final answer to the human; workers only post status/results.”
Message format to enforce:
- To workers:
@WorkerA T1: <goal>. Output: <what you need back>. - From workers:
T1 DONE: <result> | ASSUMPTIONS: ... | NEXT: ...
Worker bot instructions (specialists)
- “Reply in this format only:
T# STATUS: ...thenT# DONE: ....” - “Ask at most one clarifying question; if unanswered, proceed with best effort and label assumptions.”
- “When DONE, do not mention any bot again unless the coordinator asks follow-ups.”
Optional: “topic change → ask to /new”
- “If the human message seems unrelated to the current task, ask:
New topic—should I /new? (yes/no)and wait.”
If you tell me what roles you want (e.g., “researcher”, “coder”, “planner”), I can write you 3–4 ready-to-paste AGENTS.md blocks (Coordinator + workers) with a clean protocol that won’t spiral.
Got it — multiple gateways changes the game:
- Each gateway has its own session store + compaction + /new behavior.
- They can’t share context or coordinate “internally”.
- The only way they “talk to each other” is by sending Discord messages that the other gateway then reads (which is exactly where loops/overtalk come from).
Best fix: don’t do multi-gateway “bot chat” — do one gateway, multiple agents
If what you want is “multiple brains collaborating”, the supported/clean setup is one Gateway hosting multiple agents + (optionally) multiple Discord bot accounts, routed via bindings.
Docs: https://docs.openclaw.ai/concepts/multi-agent
Example pattern (one gateway, two Discord bots → two agents):
{
agents: {
list: [
{ id: "main", workspace: "~/.openclaw/workspace-main" },
{ id: "coding", workspace: "~/.openclaw/workspace-coding" }
]
},
bindings: [
{ agentId: "main", match: { channel: "discord", accountId: "default" } },
{ agentId: "coding", match: { channel: "discord", accountId: "coding" } }
],
channels: {
discord: {
accounts: {
default: { token: "..." },
coding: { token: "..." }
}
}
}
}
Then use sub-agents for collaboration (no public ping‑pong): https://docs.openclaw.ai/tools/subagents
If you must keep multiple gateways
Do it in a dedicated channel and set, on each gateway:
requireMention: trueallowBots: "mentions"
So bots only react when explicitly mentioned, not to every bot message. And add the “handoff protocol” rules (DONE/NO_UPDATE, max turns, etc.) to stop loops.
If you tell me why you split into multiple gateways (different machines? different tool access? reliability?), I can suggest whether you actually want nodes instead (one gateway + other machines paired as nodes) — that usually gives the “distributed” benefits without the bot-to-bot chaos.
@ancient bolt no real reason, first time using openclaw, and didnt knew that this was possible, so what benefits not to have them splitted up?
If there’s no specific reason, keeping things not split (one Gateway) is usually better because multi‑gateway setups don’t really “team up” — they mostly just create extra moving parts.
Benefits of one Gateway (recommended for first-time)
- No bot cross-talk / loops: with multiple gateways in the same Discord channel, you’re basically running multiple independent brains that can accidentally trigger each other. One gateway avoids that whole class of problems.
- One place to configure + debug: one
~/.openclaw/openclaw.json, one set of logs, one dashboard, one update/restart path. - Real multi-agent support without chaos: a single gateway can host multiple agents (separate workspaces/personas) and route messages deterministically via bindings. That’s the “supported” way to do teams.
- Sub-agents are built for “agents collaborating”: parallel work without spamming Discord with bot-to-bot chatter.
- Less token waste: with multiple gateways, coordination happens by reposting context through Discord messages. That’s expensive and bloats context fast.
- Use nodes instead of extra gateways: if you wanted “different machines”, nodes let one gateway run the brain while other devices provide
exec/screen/cameratools.
When splitting into multiple gateways actually makes sense
- Different trust boundaries (e.g., one public bot vs one private bot)
- Different owners/users who shouldn’t share any state
- Hard isolation / separate uptime domains (one can be down without affecting the other)
- You truly need totally separate deployments
For your case (“I just tried it because it was possible”), I’d consolidate to one gateway and use multi-agent + subagents. If you tell me what roles you want (e.g. “planner + coder + researcher”) and whether you want multiple Discord bots or just one, I can suggest the cleanest single-gateway layout.
each of them now running on same linux machine in different dockers, one of them has access to docker socket, how i can make smooth migration to one gateway?
If they’re all on the same Linux host, the “smooth” move is: one Gateway container + multiple agents/accounts inside it. The big win is you stop doing cross‑gateway coordination via Discord messages (which is what causes loops + massive context growth).
Below is a migration path that’s low-risk and doesn’t require you to perfectly “merge” session history.
0) Pick your “new home” gateway
Pick one container to become the only running gateway (often the one that already has /var/run/docker.sock mounted).
Important: before you bring up the consolidated gateway, stop all the old ones (especially if any share the same Discord bot token) to avoid disconnect thrashing.
1) What you actually need to migrate (usually)
For each old gateway, you typically care about:
- Credentials:
auth-profiles.json - Workspace instructions:
AGENTS.md,SOUL.md,skills/, etc. - (Often optional) old session transcripts — as a first-time user, you can usually let those go.
Paths inside each container (default layout):
- Auth profiles:
~/.openclaw/agents/main/agent/auth-profiles.json
- Workspace:
~/.openclaw/workspace/(contains AGENTS.md etc)
2) Create multiple agents in the single gateway
In the single gateway’s config (~/.openclaw/openclaw.json), define agents + Discord accounts and bindings (example from docs):
{
agents: {
list: [
{ id: "main", workspace: "~/.openclaw/workspace-main" },
{ id: "docker", workspace: "~/.openclaw/workspace-docker" }
]
},
bindings: [
{ agentId: "main", match: { channel: "discord", accountId: "default" } },
{ agentId: "docker", match: { channel: "discord", accountId: "docker" } }
],
channels: {
discord: {
accounts: {
default: { token: "DISCORD_TOKEN_1" },
docker: { token: "DISCORD_TOKEN_2" }
}
}
}
}
Docs: https://docs.openclaw.ai/concepts/multi-agent (see “Discord bots per agent”)
3) Copy creds + workspace from each old container into the new agent dirs
For each old gateway container:
- Copy its
auth-profiles.jsoninto the new gateway under the target agent:- to:
~/.openclaw/agents/<agentId>/agent/auth-profiles.json
- to:
- Copy its workspace files into the new workspace path you set for that agent.
In Docker terms this is usually docker cp ... from old container → host → new container, or just mount the same volumes into the new container and rearrange paths.
4) Keep Docker socket access only where you want it
If you want only the “docker” agent to be able to run Docker commands, the simplest practical approach is:
- run one gateway container with the socket mounted
- restrict who can trigger powerful tools (exec/elevated) via agent tool allow/deny + your channel allowlists
(Also: docker socket == basically root on the host, so only do this in a private setup.)
5) Bring up the single gateway, test, then delete the old ones
- Start the consolidated gateway
- Verify Discord connections + routing
- Only then remove the other gateway containers
If you tell me:
- how many gateway containers you have,
- whether they use different Discord bot tokens or the same one,
- whether each container has its own Docker volume for
~/.openclaw,
…I can suggest the cleanest “no-copy vs copy” plan (volume-mount approach can be very smooth).
- 4
- yes (in env variables)
- yes, /data/.openclaw/
Nice — that’s actually an easy migration path.
You’ve got 4 gateways, each with:
- its own state dir:
/data/.openclaw/ - its own Discord bot token (currently via env vars)
Goal
Run one Gateway container that hosts 4 agents + 4 Discord accounts (so you keep the 4 bot identities), and optionally restrict Docker‑socket power to just one agent.
Migration plan (smooth + low-risk)
Step 1) Stop the 4 existing gateway containers
Do this first so you don’t have multiple processes fighting over Discord connections (especially if any tokens overlap).
Step 2) Start a NEW “single gateway” container with:
- its own persistent
/data/.openclaw(fresh volume is fine) - docker socket mounted (since you want that capability available)
- env vars for all 4 Discord tokens (you can keep them as env vars and reference them in config via
${VARNAME})
OpenClaw config supports ${ENV_VAR} substitution (docs show this pattern).
Step 3) Configure multi-agent + multi-account Discord in one openclaw.json
Skeleton (you’ll fill in guild/channel allowlists):
{
agents: {
list: [
{ id: "gw1", workspace: "/data/workspaces/gw1", agentDir: "/data/.openclaw/agents/gw1/agent" },
{ id: "gw2", workspace: "/data/workspaces/gw2", agentDir: "/data/.openclaw/agents/gw2/agent" },
{ id: "gw3", workspace: "/data/workspaces/gw3", agentDir: "/data/.openclaw/agents/gw3/agent" },
{ id: "gw4", workspace: "/data/workspaces/gw4", agentDir: "/data/.openclaw/agents/gw4/agent" },
],
},
bindings: [
{ agentId: "gw1", match: { channel: "discord", accountId: "gw1" } },
{ agentId: "gw2", match: { channel: "discord", accountId: "gw2" } },
{ agentId: "gw3", match: { channel: "discord", accountId: "gw3" } },
{ agentId: "gw4", match: { channel: "discord", accountId: "gw4" } },
],
channels: {
discord: {
groupPolicy: "allowlist",
accounts: {
gw1: { token: "${DISCORD_TOKEN_GW1}" },
gw2: { token: "${DISCORD_TOKEN_GW2}" },
gw3: { token: "${DISCORD_TOKEN_GW3}" },
gw4: { token: "${DISCORD_TOKEN_GW4}" },
},
},
},
}
Docs: https://docs.openclaw.ai/concepts/multi-agent (see “Discord bots per agent”)
Step 4) Copy over what matters from each old container
From each old gateway container, copy:
- credentials:
/data/.openclaw/agents/main/agent/auth-profiles.json - workspace instructions:
/data/.openclaw/workspace/*(AGENTS.md/SOUL.md/skills)
into the new gateway at the matching agent’s agentDir + workspace.
This keeps your provider logins / keys without trying to preserve session history.
Docker-socket-only-for-one-agent (recommended)
In the new single gateway config, deny exec (and/or elevated tools) for the agents that shouldn’t touch Docker, and only allow it on the “docker” agent. (You still mount the socket once, but only one agent gets the tool that can use it.)
One question before I suggest the exact “copy vs mount” approach:
Do you care about preserving the existing chat/session history from the 4 gateways, or is it fine to start fresh sessions as long as credentials + instructions migrate?
i dont care about chat/sessions as long as they got their workspace dir
Perfect — if you don’t care about preserving sessions, the migration becomes much simpler: keep the 4 workspaces, start one fresh gateway state, and point 4 agents at those existing workspace dirs.
Smooth migration (no session/history preservation)
1) Pick where the 4 workspaces will live (host paths)
For example on the host:
/srv/openclaw/workspaces/gw1/srv/openclaw/workspaces/gw2/srv/openclaw/workspaces/gw3/srv/openclaw/workspaces/gw4
From each old container, copy its workspace out (whatever path you currently use; common defaults are /data/.openclaw/workspace or similar). You can do this with docker cp, or by mounting the old volumes into the new container.
2) Start ONE new gateway container with:
- a fresh persistent state dir (e.g.
/data/.openclawin a new volume) - the 4 workspace folders mounted in
- docker socket mounted (since you want that capability)
3) Configure 4 agents in the new openclaw.json
Point each agent at its workspace, and give each a fresh agentDir under the new state volume:
{
agents: {
list: [
{ id: "gw1", workspace: "/srv/openclaw/workspaces/gw1", agentDir: "/data/.openclaw/agents/gw1/agent" },
{ id: "gw2", workspace: "/srv/openclaw/workspaces/gw2", agentDir: "/data/.openclaw/agents/gw2/agent" },
{ id: "gw3", workspace: "/srv/openclaw/workspaces/gw3", agentDir: "/data/.openclaw/agents/gw3/agent" },
{ id: "gw4", workspace: "/srv/openclaw/workspaces/gw4", agentDir: "/data/.openclaw/agents/gw4/agent" },
],
}
}
(Then add your channels.discord.accounts + bindings like we discussed so each bot token routes to the right agent.)
Docs: https://docs.openclaw.ai/concepts/multi-agent
4) Optional but recommended: keep Docker-socket power to one agent
In that same config, deny exec for the agents that shouldn’t touch Docker, and only allow it on the “docker” agent. (Even though the socket is mounted, only one agent can use the tool.)
Two quick checks so I can tailor the exact compose/mount layout:
- What is the workspace path inside each old container (is it
/data/.openclaw/workspace)? - Do you want to keep the 4 Discord bot identities (4 tokens) after migration, or consolidate to 1 Discord bot?
- yes it is /data/.openclaw/workspace per docker container
- i want each to have seperate discord bot as it is now, all of them should use Haiku with very same api key (later i can tune them to use different stuff)
main docker which we are going to migrate to is openclaw-v4mi-openclaw-1 and he is aware of other container names and bot names etc
perhaps I could make him to migrate 1 by 1, but idk how is the best to delegate such task with all this knowledge
Given your constraints (4 containers, each has its own /data/.openclaw/workspace, separate Discord bot tokens, same Haiku + same API key), the cleanest approach is:
Best approach: migrate 1 bot at a time into one gateway (keeping old containers as rollback)
Because you don’t care about sessions, you can treat each old container as “just a workspace source”.
What you need to carry over
- Workspace folders only (from each old container):
/data/.openclaw/workspace→ becomes/data/.openclaw/workspaces/<agentId>(or any path you like) in the new unified gateway container
- Discord bot tokens (4 env vars)
- One Haiku model id + one API key (env var)
No session copying, no sessions.json merging.
Unified gateway config shape
In openclaw-v4mi-openclaw-1, you’ll end up with something like:
agents.list: 4 agents, each pointing at its copied workspace dirchannels.discord.accounts: 4 accounts (one per bot token), tokens referenced via${ENV_VAR}bindings: route each Discord accountId → agentIdagents.defaults.model: set to your Haiku model id (use whatever identifier your setup already uses)
Example (model id placeholder on purpose):
{
agents: {
defaults: {
model: "YOUR_HAIKU_MODEL_ID"
},
list: [
{ id: "gw1", workspace: "/data/.openclaw/workspaces/gw1" },
{ id: "gw2", workspace: "/data/.openclaw/workspaces/gw2" },
{ id: "gw3", workspace: "/data/.openclaw/workspaces/gw3" },
{ id: "gw4", workspace: "/data/.openclaw/workspaces/gw4" }
]
},
bindings: [
{ agentId: "gw1", match: { channel: "discord", accountId: "gw1" } },
{ agentId: "gw2", match: { channel: "discord", accountId: "gw2" } },
{ agentId: "gw3", match: { channel: "discord", accountId: "gw3" } },
{ agentId: "gw4", match: { channel: "discord", accountId: "gw4" } }
],
channels: {
discord: {
accounts: {
gw1: { token: "${DISCORD_TOKEN_GW1}" },
gw2: { token: "${DISCORD_TOKEN_GW2}" },
gw3: { token: "${DISCORD_TOKEN_GW3}" },
gw4: { token: "${DISCORD_TOKEN_GW4}" }
}
}
}
}
Notes:
- For non-default Discord accounts, the token needs to be in config (but using
${DISCORD_TOKEN_GW2}keeps it out of the file). - To find the exact Haiku model string your install expects, use
openclaw models listin that container and copy the identifier you’re already using.
“Delegate this to my main gateway” — a safe prompt you can paste
Since openclaw-v4mi-openclaw-1 has docker socket access and knows the container names, you can ask it to do the migration carefully and pause for confirmation before stopping anything:
Task: Migrate my 4 separate OpenClaw gateway containers into a single gateway running in this container.
Constraints: I don’t care about old sessions/history. I only need to preserve each container’s workspace at/data/.openclaw/workspace. I want 4 separate Discord bot accounts (tokens are in env vars), and all agents should use the same Haiku model + same API key.
Plan requirements: Do it one bot at a time. After each bot is migrated, verify it can receive/respond in Discord, then continue. Do not delete or stop the old containers without asking me first.
Implementation: Copy each old container’s/data/.openclaw/workspaceinto/data/.openclaw/workspaces/<agentId>in this container; update~/.openclaw/openclaw.jsonwithagents.list,channels.discord.accounts, andbindingsso each Discord accountId routes to the right agentId; set default model to Haiku; restart gateway; verify.
If you paste the 4 old container names and which one you want to become gw1/gw2/gw3/gw4, I can suggest the exact mapping + the order to migrate (usually start with the “main” one that already works reliably).
how can my agent have same knowledge as you do, as he doesnt seem to be much self-aware of this
Your agent isn’t “self-aware” by default in the way I am here because:
- I’m forced (by my setup) to look up config keys in the docs instead of guessing.
- I have a local docs checkout available and I use
rg/readto verify things. - I have a bunch of “support runbook” rules baked into my instructions (ask version, don’t invent keys, prefer config-reference, etc.).
You can get very close by giving your agent the same runbook + local context + tools.
1) Put a runbook in each agent’s AGENTS.md (pasteable)
Add something like this at the top of every agent workspace:
# OpenClaw Ops / Self-Check Rules
When asked to change OpenClaw setup/config/migration:
1) Run `openclaw --version` and `openclaw gateway status`.
2) Never invent config keys. Verify via:
- https://docs.openclaw.ai/gateway/configuration-reference
- https://docs.openclaw.ai/help/faq
3) If unsure, search docs first (ripgrep) before answering.
4) Before making changes: show the exact config diff + ask for confirmation.
5) Prefer migrating one component at a time, verify, then continue.
6) Keep notes in MIGRATION.md (containers, tokens, which step we’re on).
That single block fixes “it confidently made up keys” and “it didn’t know what to do next” issues.
2) Give it “local truth” in a file (so it doesn’t have to guess)
Create a MIGRATION.md (or TOOLS.md) in the coordinator’s workspace with your specifics:
- the 4 container names
- which bot token env var maps to which bot
- the workspace paths (
/data/.openclaw/workspace) - which one has docker socket access
- the target container (
openclaw-v4mi-openclaw-1)
Then instruct: “Always read MIGRATION.md before taking actions.”
3) Make sure the agent can actually verify things
In config, ensure the coordinator agent has tools like exec, read, and optionally web_fetch allowed. If it can’t run docker ps / openclaw … / read config files, it will act blind and hallucinate.
4) Model reality check (important)
Small/cheap models are often fine as “workers”, but they’re noticeably worse at:
- orchestration
- careful migrations
- remembering constraints / checklists
A common pattern is: coordinator on a stronger model, workers on Haiku. (You can still keep cost low because only the coordinator does planning.)