#Delete Openclaw

1 messages · Page 1 of 1 (latest)

silent doveBOT
normal coyoteBOT
#

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

silent doveBOT
sturdy wing
#

chỉ mình cách uninstall totally openclaw

golden krakenBOT
#

If you want a full wipe, this is the cleanest way:

openclaw uninstall --all --yes --non-interactive

That removes the gateway service and OpenClaw state/config.

If you also cloned the repo from source, delete the repo folder after uninstalling the service.

If openclaw is already gone but the service is still running:

macOS

launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
#

Linux

systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

Docs: https://docs.openclaw.ai/install/uninstall

If you want, send your OS and how you installed it, and I’ll give you the exact “delete everything” steps.

#

Có, nếu muốn gỡ sạch hoàn toàn OpenClaw thì cách dễ nhất là:

openclaw uninstall --all --yes --non-interactive

Lệnh này là đường chính thức để gỡ service + state/config.

Nếu vẫn còn CLI sau đó, gỡ luôn package global:

pnpm remove -g openclaw

hoặc nếu bạn cài bằng npm:

#
npm rm -g openclaw

Nếu bạn chạy từ source (git clone), sau khi uninstall xong thì xóa luôn thư mục repo.

Nếu openclaw đã mất nhưng service vẫn còn chạy:

macOS

launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Linux

#
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

Docs chính thức: https://docs.openclaw.ai/install/uninstall

Nếu muốn, nói mình bạn đang dùng macOS / Linux / Windows, mình viết cho bạn đúng bộ lệnh “xóa sạch hết” theo máy của bạn.

sturdy wing
#

chỉ mình cách install openclaw

golden krakenBOT
#

Cách cài dễ nhất, chính chủ luôn:

macOS / Linux / WSL2

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

Windows (PowerShell)

iwr -useb https://openclaw.ai/install.ps1 | iex
openclaw onboard --install-daemon

Sau đó kiểm tra:

#

Nếu bạn nói mình đang dùng macOS / Ubuntu / Windows, mình sẽ viết đúng từng bước cho máy của bạn.

sturdy wing
#

cach setup openai api key

golden krakenBOT
#

Cách setup OpenAI API key trong OpenClaw:

  1. Tạo key ở đây: https://platform.openai.com/api-keys

  2. Cách dễ nhất, chạy wizard:

openclaw configure --section model

Rồi chọn OpenAI API key và paste key vào.

Hoặc chạy onboarding thẳng:

openclaw onboard --auth-choice openai-api-key

Nếu muốn truyền key qua env:

#
export OPENAI_API_KEY="sk-..."
openclaw onboard --openai-api-key "$OPENAI_API_KEY"
  1. Set model mặc định:
openclaw config set agents.defaults.model.primary openai/gpt-5.4
  1. Kiểm tra:
openclaw models list --provider openai
openclaw models status

Docs:

sturdy wing
#

change model gpt 5.4 sang gpt 4 o mini. giúp mình

golden krakenBOT
#

Được, làm cách an toàn thế này nhé, vì tên model có thể đổi theo catalog:

Đổi tạm trong chat hiện tại

/model

hoặc

/model list

rồi chọn model OpenAI mini trong list.

Nếu alias của bạn có sẵn, thường có thể dùng:

/model gpt-mini
#

Đổi mặc định toàn bộ

openclaw models list --provider openai
openclaw models set <model-hoặc-alias-bạn-muốn>
openclaw models status

Ví dụ workflow là:

  1. openclaw models list --provider openai
  2. copy đúng tên model mini đang có
  3. openclaw models set ...
  4. openclaw models status để check

Docs:

#

Nếu bạn muốn, paste output của:

openclaw models list --provider openai

mình sẽ chỉ bạn dòng nào để chọn.

sturdy wing
#

change model openai codex

golden krakenBOT
#

Nếu bạn muốn chuyển sang OpenAI Codex, làm như này:

  1. Đăng nhập Codex trước (nếu chưa có):
openclaw models auth login --provider openai-codex
  1. Xem các model Codex đang có
openclaw models list --provider openai-codex
  1. Đổi model mặc định
openclaw models set <model-trong-list>
#
  1. Kiểm tra lại
openclaw models status

Nếu chỉ muốn đổi trong chat hiện tại, dùng:

/model

hoặc

/model list

rồi chọn model Codex từ list.

Docs:

sturdy wing
#

how to apply tavily api key

golden krakenBOT
#

Easiest way:

  1. Get a key from https://tavily.com/
  2. Run:
openclaw configure --section web
  1. Choose Tavily and paste your API key

That will set Tavily as the web_search provider and enable the bundled Tavily plugin.

If you want to do it with an env var instead:

export TAVILY_API_KEY="tvly-..."
#

Then make sure your config uses Tavily:

{
  plugins: {
    entries: {
      tavily: {
        enabled: true,
        config: {
          webSearch: {
            baseUrl: "https://api.tavily.com"
          }
        }
      }
    }
  },
sturdy wing
#

chỉ mình cách nhập token telegram bằng lệnh openclaw

golden krakenBOT
#

Có, nhưng Telegram không dùng kiểu openclaw channels login telegram.

Cách đúng là nhập token vào config bằng lệnh openclaw:

openclaw config set channels.telegram.enabled true --strict-json
openclaw config set channels.telegram.botToken "123456:ABC..."
openclaw config set channels.telegram.dmPolicy "pairing"

Sau đó chạy gateway:

openclaw gateway

Rồi approve DM đầu tiên nếu cần:

#

Nếu bạn muốn, mình có thể viết luôn bộ lệnh đầy đủ cho case:

  1. chỉ chat riêng, hoặc
  2. thêm bot vào group Telegram.
sturdy wing
#

Gateway LaunchAgent was installed but not loaded; re-bootstrapped launchd service.

golden krakenBOT
#

Cái này không hẳn là lỗi nhé.

Nó có nghĩa là LaunchAgent đã được cài rồi nhưng lúc đó chưa được launchd load, nên OpenClaw tự bootstrapped lại service cho bạn.

Giờ check tiếp 2 lệnh này:

openclaw --version
openclaw gateway status

Nếu muốn kiểm tra tổng quát hơn:

openclaw status
sturdy wing
#

chỉ mìh cách nhập openai codex api key

golden krakenBOT
#

Chỗ này hơi dễ nhầm, nên nói ngắn gọn thế này:

openai-codex thường không dùng API key.
Nó dùng ChatGPT/Codex sign-in (OAuth).

Nếu bạn muốn dùng Codex trong OpenClaw, chạy:

openclaw onboard --auth-choice openai-codex

hoặc:

openclaw models auth login --provider openai-codex
#

Nếu bạn muốn nhập OpenAI API key kiểu sk-..., thì đó là route openai/*, không phải openai-codex/*:

openclaw onboard --auth-choice openai-api-key

hoặc:

openclaw configure --section model

rồi chọn OpenAI API key.

Docs:

sturdy wing
golden krakenBOT
#

Lỗi này khá rõ rồi, OpenClaw đang dùng key giả / placeholder:

sk-your-****here

Nghĩa là bạn chưa nhập API key thật của OpenAI.

Cách sửa

Lấy key thật ở:
https://platform.openai.com/api-keys

Rồi nhập lại bằng wizard:

openclaw configure --section model

hoặc:

#
export OPENAI_API_KEY="sk-..."
openclaw onboard --auth-choice openai-api-key

Check lại

openclaw --version
openclaw models status

Lưu ý quan trọng

Nếu bạn đang muốn dùng OpenAI Codex thì đừng dùng sk-... ở route openai-codex.
Codex thường cần:

#
openclaw models auth login --provider openai-codex

chứ không phải OpenAI API key thường.

Nếu muốn, paste:

openclaw --version
openclaw models status

mình sẽ chỉ đúng là bạn đang cấu hình nhầm ở openai hay openai-codex.

sturdy wing
golden krakenBOT
#

Ừ, vậy là gateway của bạn vẫn đang đọc đúng cái key giả đó, chưa đọc key thật.

Dòng này là bằng chứng:
Incorrect API key provided: sk-your-****here

Thường là 1 trong 3 case:

  1. Bạn vẫn còn để placeholder trong config / auth profile
  2. Bạn export OPENAI_API_KEY trong terminal nhưng gateway daemon không thấy
  3. Bạn đang cấu hình nhầm giữa openaiopenai-codex

Cách xử lý nhanh nhất

1) Nhập lại key bằng wizard

openclaw configure --section model
#

2) Nếu chạy gateway dạng daemon, đặt key vào file env của gateway

echo 'OPENAI_API_KEY=sk-...' >> ~/.openclaw/.env
openclaw gateway restart

3) Kiểm tra lại

openclaw --version
openclaw models status

Nếu vẫn lỗi

Tìm xem placeholder còn nằm ở đâu, nhưng đừng paste key thật lên Discord:

#

Paste giúp mình output của:

openclaw --version
openclaw models status
grep -R "sk-your-" ~/.openclaw 2>/dev/null

mình sẽ chỉ đúng file nào đang giữ key giả.

sturdy wing
#

🦞 OpenClaw 2026.4.15 (041266a)
I can grep it, git blame it, and gently roast it—pick your coping mechanism.

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openai/gpt-5.4
Fallbacks (4) : openai-codex/gpt-5.4, openai/gpt-5-codex, openai/gpt-4o-mini, acce/ACCE
Image model : -
Image fallbacks (0): -
Aliases (2) : GPT -> openai/gpt-5.4, 9router-openclaw -> acce/ACCE
Configured models (5): openai-codex/gpt-5.4, openai/gpt-5-codex, openai/gpt-5.4, openai/gpt-4o-mini, acce/ACCE

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (1): openai-codex (2)

  • acce effective=models.json:sk-27b2f...5fb1ef46 | models.json=sk-27b2f...5fb1ef46 | source=models.json: ~/.openclaw/agents/main/agent/models.json
  • anthropic effective=env:sk-ant-y...key-here | env=sk-ant-y...key-here | source=env: ANTHROPIC_API_KEY
  • anthropic-openai effective=env:sk-ant-y...key-here | env=sk-ant-y...key-here | source=env: ANTHROPIC_API_KEY
  • openai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openai:default=sk-proj-...FSUBP2oA | env=sk...re | source=env: OPENAI_API_KEY
  • openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=2 (oauth=2, token=0, api_key=0) | openai-codex:default=OAuth, openai-codex:ryanle4995@gmail.com=OAuth (ryanle4995@gmail.com)
  • openrouter effective=env:sk-or-yo...key-here | env=sk-or-yo...key-here | source=env: OPENROUTER_API_KEY
  • perplexity effective=env:sk-or-yo...key-here | env=sk-or-yo...key-here | source=env: OPENROUTER_API_KEY

OAuth/token status

như vậy đã được chưa

golden krakenBOT
#

Gần đúng rồi, nhưng chưa hẳn xong nhé.

Mình thấy 2 ý quan trọng:

1) Codex OAuth của bạn đã OK

Dòng này đẹp rồi:

  • openai-codex ... ok expires in ...

2) Nhưng default model của bạn vẫn là openai/gpt-5.4

Nghĩa là OpenClaw vẫn ưu tiên route OpenAI API key thường, không phải Codex OAuth.

Cho nên nếu bạn vẫn chat bằng default hiện tại, nó vẫn có thể đụng lỗi 401 nếu OPENAI_API_KEY đang sai / placeholder.


Nếu bạn muốn dùng Codex luôn

Hãy đổi model mặc định sang route openai-codex/* bằng cách an toàn:

#
openclaw models list --provider openai-codex
openclaw models set <model-codex-trong-list>
openclaw models status

hoặc trong chat:

/model

rồi chọn model Codex.


Nếu bạn muốn giữ openai/gpt-5.4

Thì bạn vẫn phải sửa OPENAI_API_KEY thật cho route openai/*.

#

Ngoài ra

Mình cũng thấy bạn còn vài env placeholder kiểu:

  • ANTHROPIC_API_KEY = sk-ant-...key-here
  • OPENROUTER_API_KEY = sk-or-...key-here

Cái đó không gây lỗi này ngay nếu bạn không dùng provider đó, nhưng nên dọn sau cho đỡ rối.

Kết luận ngắn:

  • Codex auth: OK
  • Lỗi 401 còn có thể xảy ra vì default vẫn đang là OpenAI API route, không phải Codex route

Docs:

#

Nếu muốn, mình có thể viết cho bạn đúng 1 lệnh duy nhất để chuyển default sang Codex.

sturdy wing
#

ryanmac@Ryans-MacBook-Pro ~ % openclaw models status

🦞 OpenClaw 2026.4.15 (041266a)
I don't have opinions about tabs vs spaces. I have opinions about everything else.

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openai/gpt-5.4
Fallbacks (4) : openai-codex/gpt-5.4, openai/gpt-5-codex, openai/gpt-4o-mini, acce/ACCE
Image model : -
Image fallbacks (0): -
Aliases (2) : GPT -> openai/gpt-5.4, 9router-openclaw -> acce/ACCE
Configured models (5): openai-codex/gpt-5.4, openai/gpt-5-codex, openai/gpt-5.4, openai/gpt-4o-mini, acce/ACCE

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (1): openai-codex (2)

  • acce effective=models.json:sk-27b2f...5fb1ef46 | models.json=sk-27b2f...5fb1ef46 | source=models.json: ~/.openclaw/agents/main/agent/models.json
  • anthropic effective=env:sk-ant-y...key-here | env=sk-ant-y...key-here | source=env: ANTHROPIC_API_KEY
  • anthropic-openai effective=env:sk-ant-y...key-here | env=sk-ant-y...key-here | source=env: ANTHROPIC_API_KEY
  • openai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openai:default=sk-proj-...FSUBP2oA | env=sk...re | source=env: OPENAI_API_KEY
  • openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=2 (oauth=2, token=0, api_key=0) | openai-codex:default=OAuth, openai-codex:ryanle4995@gmail.com=OAuth (ryanle4995@gmail.com)
  • openrouter effective=env:sk-or-yo...key-here | env=sk-or-yo...key-here | source=env: OPENROUTER_API_KEY
  • perplexity effective=env:sk-or-yo...key-here | env=sk-or-yo...key-here | source=env: OPENROUTER_API_KEY

OAuth/token status

kiểm tra xem đc chưa @golden kraken

golden krakenBOT
#

Gần rồi, nhưng mình đọc kết quả này như sau:

Cái nào đã OK

  • openai-codex: nhìn ổn, OAuth đang healthy
  • openai: có profile API key thật (sk-proj-...)

Cái nào chưa chắc 100%

Lệnh openclaw models status chỉ cho thấy config/auth đang có, chưa phải live test.

Muốn biết OpenAI route có hết 401 thật chưa, chạy thêm:

openclaw models status --probe --probe-provider openai

Nếu muốn test Codex luôn:

#
openclaw models status --probe --probe-provider openai-codex

Điểm quan trọng

Default của bạn vẫn là:

openai/gpt-5.4

Nên nếu mục tiêu của bạn là dùng Codex, thì hiện tại bạn chưa switch sang Codex làm default đâu.

Kết luận ngắn

  • Codex auth: OK
  • OpenAI key: có vẻ đã lưu
  • Muốn chắc chắn hết lỗi 401 thì phải chạy --probe
  • Muốn dùng Codex mặc định thì phải đổi default model
#

Ngoài ra, bạn vẫn còn mấy env placeholder cho anthropicopenrouter, không sao ngay lúc này nhưng nên dọn sau.

Docs: https://docs.openclaw.ai/cli/models

Nếu bạn muốn, gửi luôn output của:

openclaw models status --probe --probe-provider openai

mình check nốt cho.

sturdy wing
#

input teleegram token

golden krakenBOT
#

To input a Telegram token in OpenClaw, use:

openclaw config set channels.telegram.enabled true --strict-json
openclaw config set channels.telegram.botToken "123456:ABC..."
openclaw config set channels.telegram.dmPolicy "pairing"
openclaw gateway restart

If you prefer env var instead:

echo 'TELEGRAM_BOT_TOKEN=123456:ABC...' >> ~/.openclaw/.env
openclaw gateway restart

Then start/check:

sturdy wing
#

error @golden kraken gateway connect failed: GatewayClientRequestError: pairing required

Error: gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /Users/ryanmac/.openclaw/openclaw.json
Bind: loopback

golden krakenBOT
#

Cái này thường có nghĩa là device/client chưa được approve cho gateway, hoặc đang bị scope upgrade.

Làm theo thứ tự này nhé:

openclaw devices list

Nếu thấy request pending, approve nó:

openclaw devices approve <requestId>

Rồi thử lại:

#

Nếu bạn muốn, paste output của:

openclaw devices list

mình xem giúp request nào cần approve.

sturdy wing
#

lệnh openclaw doctor và cách fix

golden krakenBOT
#

openclaw doctor là lệnh kiểm tra + sửa lỗi + migrate config/state của OpenClaw.

Lệnh cơ bản

openclaw doctor

Nó sẽ:

  • check config lỗi / key cũ
  • check service gateway
  • check auth / state / permissions
  • gợi ý cách sửa
  • có thể tự repair một số thứ

Các mode hay dùng

#
openclaw doctor

Chạy bình thường, có hỏi trước khi sửa

openclaw doctor --yes

Tự accept các prompt mặc định

openclaw doctor --repair

Tự apply các fix được khuyến nghị

#
openclaw doctor --repair --force

Sửa mạnh tay hơn, có thể overwrite supervisor/service config custom

openclaw doctor --non-interactive

Không hỏi, chỉ làm các migration an toàn

openclaw doctor --deep

Quét sâu hơn để tìm extra gateway installs / service lạ


#

Cách fix chuẩn

Mình khuyên đi theo thứ tự này:

openclaw --version
openclaw status
openclaw gateway status
openclaw doctor

Nếu doctor báo có repair:

openclaw doctor --repair

Xong thì restart gateway:

#
openclaw gateway restart
openclaw status

Khi nào dùng --repair --force

Chỉ dùng khi:

  • service launchd/systemd bị lệch
  • config supervisor bị hỏng
  • doctor bảo cần rewrite service config

Không thì cứ dùng openclaw doctor hoặc openclaw doctor --repair trước.

Docs:

sturdy wing
#

Your AI assistant, now without the $3,499 headset.


gateway connect failed: GatewayClientRequestError: pairing required

Error: gateway closed (1008): pairing required

golden krakenBOT
#

Cái lỗi thật là dòng này:

gateway connect failed: ... pairing required
Error: gateway closed (1008): pairing required

Nó có nghĩa là client/device của bạn chưa được approve với gateway, hoặc đang xin thêm scope mới.

Fix nhanh

openclaw devices list

Nếu thấy request pending:

#
openclaw devices approve <requestId>

Sau đó thử lại:

openclaw gateway status
openclaw status

Nếu vẫn bị

Chạy tiếp:

openclaw doctor
openclaw devices list
sturdy wing
#

hướng dẫn mình fully uninstall openclaw

golden krakenBOT
#

Có nhé. Nếu muốn gỡ sạch hoàn toàn OpenClaw, làm theo cách này:

Cách nhanh nhất

openclaw uninstall --all --yes --non-interactive

Lệnh này là đường chính thức để gỡ service + state/config.


Nếu muốn tự gỡ tay cho sạch

1) Stop gateway

openclaw gateway stop
#

2) Uninstall service

openclaw gateway uninstall

3) Xóa state + config

rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

4) Xóa workspace (nếu có)

rm -rf ~/.openclaw/workspace

5) Gỡ CLI global

Nếu cài bằng pnpm:

#
pnpm remove -g openclaw

Nếu cài bằng npm:

npm rm -g openclaw

6) Nếu bạn chạy từ source (git clone)

Sau khi uninstall service xong, xóa luôn thư mục repo.


Nếu CLI đã mất nhưng service vẫn còn chạy

macOS

#
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Linux

systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

Docs chính thức: https://docs.openclaw.ai/install/uninstall

Nếu muốn, mình có thể viết riêng cho bạn bộ lệnh đúng theo macOS hoặc Ubuntu/Linux luôn.

sturdy wing
#

⚠️ ⏰ Cron: multica-project-loop failed

#

gateway connect failed: GatewayClientRequestError: pairing required roate liên tục làm sao fix được

golden krakenBOT
#

Nếu nó bị pairing required lặp hoài, thường là 1 trong 2 kiểu:

  1. bạn approve requestId cũ
  2. device/token cũ bị stale nên cứ xin pair lại mãi

Cách fix chuẩn

Bước 1, lấy request mới nhất

openclaw devices list

Bước 2, approve đúng requestId mới nhất

openclaw devices approve <requestId_mới_nhất>
#

Quan trọng: nếu device retry với auth/scopes khác, request cũ sẽ bị superseded.
Nên phải devices list lại ngay trước khi approve.


Nếu vẫn loop tiếp

Xóa pairing cũ rồi pair lại từ đầu:

openclaw devices list
openclaw devices remove <deviceId_cũ>
openclaw devices list
openclaw devices approve <requestId_mới>

#
openclaw devices list

mình chỉ luôn cái nào là deviceId cũ, cái nào là requestId mới để bạn chạy đúng lệnh.

sturdy wing
#

vẫn bị repair loop bug

golden krakenBOT
#

Ừ, nếu bạn đã remove device cũ + approve request mới nhất mà vẫn loop, thì cái này bắt đầu giống bug thật rồi.

Lấy giúp mình đúng bộ này:

openclaw --version
openclaw gateway status
openclaw devices list --json
openclaw logs --follow

Nếu đang bị loop liên tục, mở thêm một terminal và chạy:

openclaw doctor --deep
#

Thử thêm 2 cái cuối trước khi kết luận bug

openclaw gateway restart

Nếu vẫn không hết, reboot cả máy một lần, vì có case trạng thái pairing bị kẹt và reboot mới clear được.

Nếu sau đó vẫn còn

Mình nghĩ nên report bug rồi.
Mở issue ở đây: https://github.com/openclaw/openclaw/issues

Khi mở issue, đính kèm:

  • openclaw --version
  • openclaw gateway status
  • openclaw devices list --json
  • đoạn log liên quan pairing required
#

Nếu bạn paste devices list --json với đoạn log vào đây trước, mình sẽ giúp lọc xem nó là requestId supersede, scope upgrade, hay device token bị kẹt.

sturdy wing
#

🦞 OpenClaw 2026.4.15 (041266a)
Your config is valid, your assumptions are not.


◒ Checking gateway status...penclaw devices list --json
openclaw logs --follow

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-19.log
Command: /opt/homebrew/opt/node@22/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=18789

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=lan (0.0.0.0), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://10.0.0.52:18789/
Probe note: bind=lan listens on 0.0.0.0 (all interfaces); probing via 127.0.0.1.

Runtime: running (pid 653)
RPC probe: ok

Listening: *:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

golden krakenBOT
#

Cái này cho thấy gateway đang chạy bình thường rồi nhé:

  • Runtime: running
  • RPC probe: ok

Nên vấn đề không phải gateway chết, mà nằm ở lớp pairing/device auth.

Mình thấy bạn chưa paste phần quan trọng nhất là:

  1. openclaw devices list --json
  2. log có dòng pairing required

Có vẻ command bị dính vào nhau ở đây:

Checking gateway status...penclaw devices list --json

Chạy lại riêng từng lệnh này

#
openclaw devices list --json
openclaw logs --follow

Rồi khi log hiện lại lỗi pairing required, copy đoạn đó gửi mình.

Kết luận hiện tại

  • Gateway: OK
  • Config/service: OK
  • Lỗi còn lại: pairing/device token loop

Nếu devices list --json không hiện pending request nào mà vẫn bị loop, lúc đó mình nghi stale device token / repair loop bug thật.

Paste tiếp 2 output kia, mình xem nốt cho.

sturdy wing
#

openclaw devices list

#

yanmac@Ryans-MacBook-Pro ~ % openclaw devices remove 1ea244f5178d411e1edfea947ec44fefa0a0939ade0ae74c4948a95da71f86c1

🦞 OpenClaw 2026.4.15 (041266a)
I'll refactor your busywork like it owes me money.


gateway connect failed: GatewayClientRequestError: pairing required

[openclaw] Failed to start CLI: Error: gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /Users/ryanmac/.openclaw/openclaw.json
Bind: lan
at Object.onClose (file:///opt/homebrew/lib/node_modules/openclaw/dist/call-BA3do6C0.js:249:10)
at WebSocket.<anonymous> (file:///opt/homebrew/lib/node_modules/openclaw/dist/client-DkWAat_P.js:386:24)
at WebSocket.emit (node:events:519:28)
at WebSocket.emitClose (/opt/homebrew/lib/node_modules/openclaw/node_modules/ws/lib/websocket.js:273:10)
at Socket.socketOnClose (/opt/homebrew/lib/node_modules/openclaw/node_modules/ws/lib/websocket.js:1346:15)
at Socket.emit (node:events:519:28)
at TCP.<anonymous> (node:net:346:12)

golden krakenBOT
#

Đúng rồi, chạy lệnh đó:

openclaw devices list

Nếu muốn dễ đọc hơn để debug, chạy luôn:

openclaw devices list --json

Rồi paste output vào đây, mình xem:

  • pending request không
  • device cũ bị kẹt không
  • có phải scope upgrade loop không
#

Nếu có pending thì mình sẽ chỉ ngay lệnh approve chuẩn cho bạn.

#

À, mình thấy chỗ kẹt rồi.

devices remove không có local pairing fallback như devices list / devices approve, nên khi client hiện tại đang bị pairing required, lệnh remove sẽ tự fail như bạn thấy.

Cách làm đúng

Dùng gateway token/password để chạy lệnh đó, đừng dựa vào pairing của client đang lỗi.

1) Lấy gateway token tại máy local

openclaw config get gateway.auth.token

Đừng paste token lên Discord nhé.

2) Chạy lại với token

#
openclaw devices list --token "<gateway-token>"
openclaw devices remove 1ea244f5178d411e1edfea947ec44fefa0a0939ade0ae74c4948a95da71f86c1 --token "<gateway-token>"

Nếu bạn dùng password auth thay vì token:

openclaw devices remove <deviceId> --password "<gateway-password>"

3) Sau đó approve request mới nhất

openclaw devices list --token "<gateway-token>"
openclaw devices approve <requestId_mới_nhất> --token "<gateway-token>"

Vì sao bị vậy

sturdy wing
#

"deviceId": "8ca74f5829cc11b690fabd73222583a00292951b4933ce40e4f0485f54e91e51",
"publicKey": "3VAbCBHqRnd4N16AN-jFG79oV16o05f7RlNNA7yp11w",
"platform": "MacIntel",
"clientId": "openclaw-control-ui",
"clientMode": "webchat",
"role": "operator",
"roles": [
"operator"
],
"scopes": [
"operator.admin",
"operator.read",
"operator.write",
"operator.approvals",
"operator.pairing"
],
"approvedScopes": [
"operator.admin",
"operator.read",
"operator.write",
"operator.approvals",
"operator.pairing"
],
"createdAtMs": 1776634878383,
"approvedAtMs": 1776634878383,
"tokens": [
{
"role": "operator",
"scopes": [
"operator.admin",
"operator.approvals",
"operator.pairing",
"operator.read",
"operator.write"
],

golden krakenBOT
#

Ừ, đoạn này cho thấy device đó đã được approve đầy đủ rồi:

  • clientId: "openclaw-control-ui"
  • role: "operator"
  • có đủ operator.admin/read/write/approvals/pairing

Nghĩa là lỗi không còn là thiếu approve nữa.
Cái mình nghi nhất lúc này là stale device token / browser session bị kẹt.

Fix đúng case này

Cách 1, thử rotate token cho đúng device đó

openclaw config get gateway.auth.token
openclaw devices rotate --device 8ca74f5829cc11b690fabd73222583a00292951b4933ce40e4f0485f54e91e51 --role operator --token "<gateway-token>"
#

Nếu vẫn lỗi, remove hẳn device đó rồi pair lại

openclaw devices remove 8ca74f5829cc11b690fabd73222583a00292951b4933ce40e4f0485f54e91e51 --token "<gateway-token>"
openclaw devices list --token "<gateway-token>"
openclaw devices approve <requestId_mới> --token "<gateway-token>"

Sau đó

  • đóng tab dashboard/control UI hiện tại
  • mở lại bằng:
openclaw dashboard
  • nếu cần, mở tab mới / incognito rồi connect lại

Vì Control UI giữ shared token trong sessionStorage của tab hiện tại, nên tab cũ đôi khi giữ state bị kẹt.

#

Kết luận

  • pairing entry: đã approved
  • bug còn lại: stale token/session phía client

Nếu muốn, mình viết luôn cho bạn đúng 3 lệnh copy-paste với deviceId này.

sturdy wing
#

Bắt được rồi.

Gốc lỗi thật:

• cùng deviceId / publicKey
• nhưng device này hiện đang paired chỉ với:
• operator.read
• trong khi pending repair đang xin:
• operator.approvals
• operator.admin
• operator.read
• operator.write
• operator.pairing
• operator.talk.secrets

Tức là đây là scope-upgrade repair loop cho cùng một device, không phải device mới.

Cách fix đúng
Xóa paired record cũ của device đó, rồi pair lại sạch:

chỉ mình cách fixx

golden krakenBOT
#

Đúng rồi, case này là scope-upgrade loop cho cùng một device, nên fix chuẩn là:

1) Lấy gateway token

openclaw config get gateway.auth.token

Đừng paste token lên Discord.

2) Xóa paired record cũ của đúng device đó

openclaw devices remove <old-deviceId> --token "<gateway-token>"

3) List lại để lấy pending request mới nhất

#
openclaw devices list --token "<gateway-token>"

4) Approve request mới

openclaw devices approve <new-requestId> --token "<gateway-token>"

5) Đóng tab Control UI cũ, mở lại

openclaw dashboard

Nếu vẫn bị state cũ, mở bằng tab mới / incognito rồi connect lại.


#

Vì sao phải làm vậy

Device cũ chỉ được pair với:

  • operator.read

Nhưng repair mới đang xin:

  • operator.approvals
  • operator.admin
  • operator.read
  • operator.write
  • operator.pairing
  • operator.talk.secrets

Nên rotate không đủ trong case này, vì token cũ không có baseline scope đó.
Phải remove paired record cũ rồi pair lại sạch.


#

Bộ lệnh mẫu

openclaw config get gateway.auth.token
openclaw devices remove <old-deviceId> --token "<gateway-token>"
openclaw devices list --token "<gateway-token>"
openclaw devices approve <new-requestId> --token "<gateway-token>"
openclaw dashboard

Nếu muốn, gửi mình:

  • old-deviceId
  • new-requestId

mình sẽ ráp sẵn thành đúng 2 lệnh cuối cho bạn copy-paste luôn.

#

Ignore that random ticket link.

If this still needs maintainer attention, the only official place to report it is GitHub issues:
https://github.com/openclaw/openclaw/issues

For your actual fix, do this locally:

openclaw config get gateway.auth.token
openclaw devices remove <old-deviceId> --token "<gateway-token>"
openclaw devices list --token "<gateway-token>"
openclaw devices approve <new-requestId> --token "<gateway-token>"
openclaw dashboard

If it still loops after that, file the bug on GitHub with:

  • openclaw --version
#
  • openclaw gateway status
  • openclaw devices list --json
  • the pairing required log snippet
sturdy wing
#

gateway connect failed: GatewayClientRequestError: pairing required

Direct scope access failed; using local fallback.
unknown requestId
zsh: command not found: --token

🦞 OpenClaw 2026.4.15 (041266a)
I'm the assistant your terminal demanded, not the one your sleep schedule requested.

Dashboard URL: http://127.0.0.1:18789/#token=fddb5fe63ab0fe606e03b8197cc9ef59cc88687fa0912e8b
Copied to clipboard.
Opened in your browser. Keep that tab to control OpenClaw.

golden krakenBOT
#

Hai việc ngay bây giờ:

1) Rotate gateway token ngay

Bạn vừa paste token công khai trong thread rồi. Xóa message đó nếu được, rồi trên máy local chạy:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

Sau đó lấy token mới:

openclaw config get gateway.auth.token

Đừng paste token mới lên Discord.

#

2) Chạy lại lệnh theo một dòng hoàn chỉnh

Lỗi của bạn là:

  • unknown requestId = dùng requestId cũ
  • zsh: command not found: --token = bạn xuống dòng sai, nên --token bị chạy như lệnh riêng

Làm kiểu này cho đỡ lỗi:

export GW_TOKEN='TOKEN_MỚI_CỦA_BẠN'
openclaw devices list --token "$GW_TOKEN"
openclaw devices remove <old-deviceId> --token "$GW_TOKEN"
openclaw devices list --token "$GW_TOKEN"
openclaw devices approve <new-requestId> --token "$GW_TOKEN"