#Agent breaks gateway every time it tries to change something in config
1 messages ยท Page 1 of 1 (latest)
๐ฆ OpenClaw 2026.3.2 (85377a2) โ Open source means you can see exactly how I judge your config.
โ
โ Config โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Config invalid; doctor will run with best-effort config. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Doctor warnings โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ - channels.imessage.groupPolicy is "allowlist" but groupAllowFrom is empty โ this โ
โ channel does not fall back to allowFrom, so all group messages will be silently โ
โ dropped. Add sender IDs to channels.imessage.groupAllowFrom, or set groupPolicy to โ
โ "open". โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
Run: openclaw doctor --fix
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
Timed out after 60s waiting for gateway port 18789 to become healthy.
Gateway process is running but port 18789 is still free (startup hang/crash loop or very slow VM startup).
Service runtime: status=running, state=active, pid=33679
Gateway port 18789 status: free.
Gateway restart timed out after 60s waiting
If any โmeaningful changeโ bricks the gateway, 90% of the time itโs one of these:
- the gateway is crashing on startup because config/state became invalid (bad JSON5, wrong key, partial write), or
- youโre editing one config path, but the daemon/service is running with a different config (
Config (cli)vsConfig (service)), so things get weird fast.
To stop guessing, can you paste the output of these (in order)?
openclaw --version
openclaw status --all
openclaw gateway status
openclaw models status
openclaw doctor
And then (this is the money one) grab the error right when it โdestroys itโ:
openclaw logs --follow
If the gateway is so dead that openclaw logs canโt attach, the FAQ suggests tailing the latest file log in /tmp/openclaw/โฆ (the โFirst 60 seconds if somethingโs brokenโ section):
https://docs.openclaw.ai/help/faq#first-60-seconds-if-somethings-broken
Deep runbook: https://docs.openclaw.ai/gateway/troubleshooting
Two quick clarifiers that will help a lot:
- When you say โbreaks the gatewayโ, do you mean process exits (crash), or it stays running but RPC probe fails / UI says unauthorized / reconnect loop?
- What exactly was the โheartbeat changeโ? (editing
HEARTBEAT.mdin the workspace vs changing heartbeat config viaopenclaw config โฆ)
On the โintelligence has been useless for 3 daysโ part: thatโs usually model/auth/fallback (rate limits, โall models failedโ, wrong default model, provider returning 429, etc.). openclaw models status + the log snippet around a โdumbโ reply will usually make the cause obviousโpaste that and we can nail it down quickly.
That output explains exactly why the gateway โdiesโ:
- Your config is invalid, and the gateway refuses to boot with it.
- Specifically:
agents.defaults.heartbeat.targetis set tochannel:1469389732055351451, buttargetis not a Discord channel id. - When the gateway canโt parse/validate config, it can end up in a crash loop / startup hang, which is why the LaunchAgent restart times out and port
18789stays free.
Per the heartbeat docs, target must be one of:
"none"(default)"last"- or a channel name like
"discord","telegram", etc.
And if you want a specific destination, you set to separately. Docs: https://docs.openclaw.ai/gateway/heartbeat
Quick recovery (get the gateway back up)
Run:
openclaw config set agents.defaults.heartbeat.target '"none"' --json
openclaw gateway restart
That should make the config valid again and let the gateway bind to 18789.
If you actually want heartbeats to post into a Discord channel
Use:
openclaw config set agents.defaults.heartbeat.target '"discord"' --json
openclaw config set agents.defaults.heartbeat.to '"channel:1469389732055351451"' --json
openclaw gateway restart
(Assuming 1469389732055351451 is the Discord channel ID you intended.)
Also: that iMessage warning can explain โitโs uselessโ
Doctor is also warning:
channels.imessage.groupPolicyis"allowlist"butgroupAllowFromis empty โ all iMessage group messages get silently dropped
So if youโve been โtesting intelligenceโ via iMessage group chats, it may literally be ignoring everything.
If it still doesnโt bind after fixing heartbeat.target
Paste the first ~30 lines after restart from:
openclaw logs --follow
Glad you posted doctor output โ this oneโs a clean config-key mixup, and itโs totally consistent with โbreaks every time it changes something meaningfulโ.
If the fix works, please right-click the solution message โ Apps โ โ Mark Solution so Answer Overflow indexes it.
Run: openclaw doctor --fix
Invalid config at /Users/willdoylejarvis/.openclaw/openclaw.json:\n- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
๐ฆ OpenClaw 2026.3.2 (85377a2) โ You had me at 'openclaw gateway start.'
โ
โ Config โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Config invalid; doctor will run with best-effort config. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Doctor warnings โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ - channels.imessage.groupPolicy is "allowlist" but groupAllowFrom is empty โ this โ
โ channel does not fall back to allowFrom, so all group messages will be silently โ
โ dropped. Add sender IDs to channels.imessage.groupAllowFrom, or set groupPolicy to โ
โ "open". โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
Run: openclaw doctor --fix
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
Run: openclaw doctor --fix
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
Timed out after 60s waiting for gateway port 18789 to become healthy.
Gateway process is running but port 18789 is still free (startup hang/crash loop or very slow VM startup).
Service runtime: status=running, state=active, pid=36813
Gateway port 18789 status: free.
Gateway restart timed out after 60s waiting for health checks.
willdoylejarvis@Wills-Mac-mini ~ %
doctor --fix canโt fix this one automatically because itโs not a โrepairableโ state โ itโs asking you to choose a valid value.
Right now your config literally contains:
agents.defaults.heartbeat.target = "channel:1469389732055351451"โ invalid, so the gateway wonโt start cleanly.
Fix it (pick one)
Option A (safest): disable heartbeat delivery so the gateway boots
openclaw config set agents.defaults.heartbeat.target '"none"' --strict-json
openclaw config validate
openclaw gateway restart
Option B: deliver to โwhoever you last talked toโ
openclaw config set agents.defaults.heartbeat.target '"last"' --strict-json
openclaw config validate
openclaw gateway restart
Option C: deliver to a specific Discord channel
Heartbeat target must be "discord" (the channel type), and the destination goes in to:
openclaw config set agents.defaults.heartbeat.target '"discord"' --strict-json
openclaw config set agents.defaults.heartbeat.to '"channel:1469389732055351451"' --strict-json
openclaw config validate
openclaw gateway restart
Docs for this exact split (target vs to): https://docs.openclaw.ai/gateway/heartbeat
If openclaw config set ... refuses to run
Then just open the file it printed (/Users/willdoylejarvis/.openclaw/openclaw.json) and manually change/remove the bad line (heartbeat.target: "channel:..."). After that:
openclaw config validate
openclaw gateway restart
Once the gateway is up again, we can tackle the โintelligence uselessโ part โ but first we need it booting, and this invalid heartbeat target is the hard blocker.
Yep โ youโre still in the exact same loop because nothing has changed in the config yet. doctor --fix is restarting the LaunchAgent, but it cannot guess a correct heartbeat target for you, so the config stays invalid and the gateway keeps failing to bind to 18789.
You need to do one of these once, then restart.
Do this now (copy/paste)
This is the fastest โget me unbrickedโ path:
openclaw config set agents.defaults.heartbeat.target '"none"' --strict-json
openclaw config validate
openclaw gateway restart
If that works, the gateway should come up immediately.
If that command errors (because config is too broken)
Then edit the file directly:
- Open:
open ~/.openclaw/openclaw.json
- Find the line with:
agents: { defaults: { heartbeat: { target: "channel:1469389732055351451" } } }
- Change it to either:
target: "none"(safe), ortarget: "last", ortarget: "discord"+ move thechannel:...intoto
Then:
openclaw config validate
openclaw gateway restart
One question
Did you try openclaw config set ... already? If yes, paste the output/error from that command โ thatโll tell us whether itโs failing to write, or writing to a different config path than the LaunchAgent uses.
this did nothing
โopen ~/.openclaw/openclaw.jsonโ is the likely culprit here.
On macOS, open just asks LaunchServices to open the file in a GUI app. If youโre SSHโd into the Mac mini (or thereโs no GUI session), it can literally do nothing.
Letโs make this deterministic and verify what the config actually says.
1) Confirm which config file OpenClaw is using
openclaw config file
2) See the current bad value (no guessing)
openclaw config get agents.defaults.heartbeat.target
If it still prints channel:1469389732055351451, fix it via CLI (this works even when the gateway is down):
3) Force it to a valid value
openclaw config set agents.defaults.heartbeat.target '"none"' --strict-json
openclaw config get agents.defaults.heartbeat.target
openclaw config validate
openclaw gateway restart
If openclaw config set errors, paste that error
Then weโll do a direct file edit with a terminal editor:
nano ~/.openclaw/openclaw.json
(And yes: you must save in nano: Ctrl+O, Enter, Ctrl+X.)
Paste outputs from steps (1) + (2) + (3) if it still wonโt come up. That will tell us immediately whether you edited the wrong file, the write isnโt sticking, or something else is re-introducing the bad value.
willdoylejarvis@Wills-Mac-mini ~ % openclaw config file
Invalid config at /Users/willdoylejarvis/.openclaw/openclaw.json:\n- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
๐ฆ OpenClaw 2026.3.2 (85377a2) โ No $999 stand required.
โ
โ Config โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Config invalid; doctor will run with best-effort config. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Doctor warnings โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ - channels.imessage.groupPolicy is "allowlist" but groupAllowFrom is empty โ this โ
โ channel does not fall back to allowFrom, so all group messages will be silently โ
โ dropped. Add sender IDs to channels.imessage.groupAllowFrom, or set groupPolicy to โ
โ "open". โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- agents.defaults.heartbeat.target: unknown heartbeat target: channel:1469389732055351451
Run: openclaw doctor --fix
Got it โ that output tells us something important:
openclaw config โฆ is refusing to run while the config is invalid (it validates up front, then bails and tells you to run Doctor). So we canโt use openclaw config set to repair this one until the file is manually fixed.
So the fix path is: edit the JSON5 file directly once, then the CLI tools work again.
Fix it via terminal editor (works over SSH)
Run:
nano /Users/willdoylejarvis/.openclaw/openclaw.json
In nano:
- Press
Ctrl+W(search) - Type
channel:1469389732055351451(or justheartbeat.target) and press Enter - Change the value from:
target: "channel:1469389732055351451"
to either:
target: "none"
(or "last" if you want deliveries to your last chat)
- Save:
Ctrl+Othen Enter - Exit:
Ctrl+X
Then validate + restart:
openclaw config validate
openclaw gateway restart
If you want heartbeat to go to a specific Discord channel
Do not put the channel id in target. After you get the gateway booting again, set:
heartbeat: {
target: "discord",
to: "channel:1469389732055351451",
}
Docs: https://docs.openclaw.ai/gateway/heartbeat
If you paste just the agents.defaults.heartbeat { ... } block from your openclaw.json after editing, I can sanity-check it before you restart.
how to i get my agent to stop doing shit that breaks the gateway?
is there a best practice doc i can give it or sometihng/
Stop giving it the loaded gun.
What broke you here is: the agent had a path to write config / restart the gateway, and it wrote an invalid value. OpenClaw is strict about config validity, so one bad write = gateway wonโt boot.
You fix this by restricting tools, not by โasking it nicelyโ.
1) Hard-block gateway/config mutations from the model
In ~/.openclaw/openclaw.json, add a tools deny:
{
tools: {
deny: ["gateway"], // blocks gateway restart + config apply/patch/update from the agent
},
}
Restart the gateway after.
Docs: https://docs.openclaw.ai/tools (see โDisabling toolsโ + tool inventory for gateway)
2) (Optional but recommended) Block shell exec too
If your agent can run shell commands, it can also trash config that way. Deny runtime tools:
{
tools: {
deny: ["gateway", "group:runtime"], // exec/bash/process
},
}
If you do want exec sometimes, donโt fully deny itโuse approvals instead:
- Set exec approvals to
security: "allowlist"+ask: "always"(or at leaston-miss)
Docs: https://docs.openclaw.ai/tools/exec-approvals
3) Operational pattern that doesnโt brick you
Tell your agent: โPropose config changes as a JSON5 snippet; do not apply them.โ
Then you paste/apply.
If you paste your current tools: block (and your agents.list ids) I can tell you the smallest denylist that will stop gateway-bricking while keeping the tools you actually want.
Yep โ two docs are basically โbest practicesโ for exactly this:
-
Tools policy (how to prevent the model from having the ability to mutate config / restart gateway):
https://docs.openclaw.ai/tools
(see:tools.allow/tools.deny, tool profiles, and the fact that thegatewaytool includes config apply/patch + restart) -
Security / hardening baseline (why you should keep control-plane tools away from normal chats):
https://docs.openclaw.ai/gateway/security
(see: โHardened baseline in 60 secondsโ)
And for the specific heartbeat footgun you hit:
https://docs.openclaw.ai/gateway/heartbeat (target vs to)
What to โgive your agentโ (practical snippet for AGENTS.md / your system instructions)
You can paste something like this into your agentโs AGENTS.md:
Ops safety rule: Never edit
~/.openclaw/openclaw.jsonor call any gateway/config-update/restart tool.
If asked to change config, only propose the exact JSON5 snippet (or a minimal diff) and ask for explicit human approval before any change.
But the real best practice is: donโt rely on the doc/prompt alone โ enforce it with tools.deny: ["gateway"] (and optionally group:runtime) so it canโt do the breaking thing even if it tries.
If you want, paste your current tools: config block and Iโll suggest a โsafe but still usefulโ tool policy.
now i keep getting htis: LLM request rejected: messages.53.content.2: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
That error is an Anthropic API invariants thing (itโs not you โprompting wrongโ):
thinking/redacted_thinkingblocks in the latest assistant message must be sent back byte-for-byte identical on the next request.
If anything in your stack โrewritesโ that last assistant message (compaction, redaction, message edit, etc.), Anthropic rejects the next call with exactly what youโre seeing.
Fastest unblock
-
Start a fresh session (so the corrupted last-message isnโt in history anymore).
- In chat: send
/new - Or switch to a different Discord channel/thread (new session key)
- In chat: send
-
After that, Iโd also temporarily disable thinking for the session to reduce the chance of re-hitting it:
- Send:
/think off - (Optional) also:
/reasoning off(separate from thinking, but keeps things simpler while debugging)
- Send:
Docs on thinking directives: https://docs.openclaw.ai/tools/thinking