Last updated on

Save OpenClaw When It ‘Suddenly Stops Working’: Check Config + Roll Back with 2 Commands


There’s a particularly frustrating kind of failure: OpenClaw was working fine, you tweak a config value (or update something), and then the Gateway suddenly stops working.

“Debugging” often turns into: opening a long JSON file, hunting for the right section, and worrying you’ll accidentally leak tokens/secrets when you paste logs to ask for help.

This post keeps it simple—two commands:

  • poc-config (or poc_config): quickly print the config section you need, with sensitive values automatically redacted
  • oprollback: automatically roll back openclaw.json to the most recent backup that makes the Gateway healthy again

The pain points

1) “I need to inspect config, but I can’t leak secrets”

openclaw.json often contains tokens, API keys, passwords, cookies, etc. Sharing it (or even a screenshot) is risky.

2) “One small config mistake can take the Gateway down”

A missing comma, a wrong value, or an auth/bind setting can break startup. When that happens, you need an Undo button—fast.


The 2-command rescue kit

1) poc-config: print config fast (and safely)

Instead of opening the whole file, you can print exactly what you need by path, for example gateway, plugins, or something deeper like plugins.telegram.

Examples:

poc-config gateway
poc-config 'plugins.telegram'

If you want to paste output into chat/logs safely, you can replace any token fields in the printed output with a harmless placeholder:

poc-config gateway -t "sensakai.com"

What it does:

  • Automatically redacts sensitive keys like secret, apiKey, password, authorization, cookie, etc.
  • For keys containing token, it prints your chosen replacement (default: sensakai.com) instead of the real token

You can use both names: poc-config and poc_config.


2) oprollback: roll back to the last known-good config

When the Gateway is down and you don’t want to guess what you broke, oprollback will:

  • Find backup files like openclaw.json.bak, openclaw.json.bak.1, openclaw.json.bak.2, …
  • Try them from newest → older
  • For each candidate: swap config → restart Gateway → verify health
  • If a candidate fails, it reverts and tries the next
  • It always creates a safety backup first: openclaw.json.pre-rollback.<timestamp>

Preview candidates (no changes):

oprollback --dry-run

Perform rollback:

oprollback

  1. Quickly inspect Gateway config (safe to share):
poc-config gateway
  1. If the Gateway still won’t come up, roll back immediately:
oprollback
  1. Once it’s running again, inspect plugins/config around what you changed:
poc-config plugins
# or
poc-config 'plugins.telegram'

Install poc-config and oprollback

The scripts are published in this GitLab project:

Step 1: Download both files

mkdir -p ~/tools/sensakai-openclaw
cd ~/tools/sensakai-openclaw

curl -fsSL -o print_openclaw_config.py \
  https://gitlab.com/sensakai.com/sensakai.com/-/raw/main/print_openclaw_config.py

curl -fsSL -o oprollback.py \
  https://gitlab.com/sensakai.com/sensakai.com/-/raw/main/oprollback.py

Step 2: Make them executable

chmod +x print_openclaw_config.py oprollback.py

Step 3: Create global commands via ~/.local/bin

mkdir -p ~/.local/bin

# poc-config + poc_config (two names, same script)
ln -sf "$PWD/print_openclaw_config.py" ~/.local/bin/poc_config
ln -sf "$PWD/print_openclaw_config.py" ~/.local/bin/poc-config

# oprollback
ln -sf "$PWD/oprollback.py" ~/.local/bin/oprollback

Step 4: If you get “command not found”, add ~/.local/bin to PATH

Bash:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Zsh:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Quick sanity check

poc-config --help
oprollback --help

poc-config gateway
oprollback --dry-run

FAQ (for non-technical users)

1) Why does poc-config say “command not found”?

Usually your shell can’t see ~/.local/bin yet.

Check:

echo $PATH | tr ':' '\n' | grep -n "$HOME/.local/bin" || echo "MISSING ~/.local/bin in PATH"
ls -la ~/.local/bin | grep -E 'poc_config|poc-config|oprollback'

If it’s missing, add it to PATH (see install step 4).


2) Is poc-config the same as poc_config?

Yes. They’re just two aliases pointing to the same script.


3) Does poc-config modify my config file?

No. It only reads ~/.openclaw/openclaw.json and prints a redacted version.


4) What does -t/--token do? Does it change my real token?

No. It only changes what gets printed to your terminal so you can share logs safely.


5) What does “path” mean in poc-config?

It’s the section you want to print from the JSON config.

Examples:

poc-config gateway
poc-config plugins
poc-config 'plugins.telegram'
poc-config 'plugins["telegram"]'

6) Is oprollback dangerous? Will I lose my current config?

oprollback does modify ~/.openclaw/openclaw.json, but it creates a safety backup first:

  • openclaw.json.pre-rollback.<timestamp>

If a rollback attempt fails, it reverts and tries another backup.


7) How do I preview what it would roll back to?

oprollback --dry-run

8) How does oprollback decide the Gateway is healthy?

It runs:

openclaw gateway status

…and checks for indicators like Runtime: running and RPC probe: ok.


9) If rollback still doesn’t fix it, what should I share for support?

These three are a good minimum (and safe if you use poc-config):

poc-config gateway
poc-config plugins
openclaw gateway status

10) Why do I have files like openclaw.json.bak, openclaw.json.bak.1, …?

Those are time-based backups. oprollback uses them to travel back to a working configuration.


Conclusion

If you’ve ever hit the “OpenClaw suddenly stopped working” moment, the #1 priority isn’t to immediately find the root cause—it’s to get the system back online fast.

  • poc-config helps you print the exact config you need in seconds, and it’s safe to share because secrets are automatically redacted.
  • oprollback is your “life raft”: if you broke config changes, it helps you restore the most recent working config without needing to remember what you changed.

Think of these as two survival buttons for OpenClaw: inspect fast (poc-config) and recover fast (oprollback).