#Delete Openclaw
1 messages · Page 1 of 1 (latest)
chỉ mình cách uninstall totally openclaw
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.
chỉ mình cách install openclaw
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:
openclaw --version
openclaw doctor
openclaw gateway status
Nếu bạn muốn cài bằng package manager thì dùng:
pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon
Docs:
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.
cach setup openai api key
Cách setup OpenAI API key trong OpenClaw:
-
Tạo key ở đây: https://platform.openai.com/api-keys
-
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"
- Set model mặc định:
openclaw config set agents.defaults.model.primary openai/gpt-5.4
- Kiểm tra:
openclaw models list --provider openai
openclaw models status
Docs:
- OpenAI provider: https://docs.openclaw.ai/providers/openai
- Configure wizard: https://docs.openclaw.ai/cli/configure
Lưu ý nhỏ: OpenAI API key dùng cho model openai/*, còn openai-codex/* là route khác. Nếu muốn mình có thể viết luôn đúng từng bước cho Windows / Ubuntu / macOS.
change model gpt 5.4 sang gpt 4 o mini. giúp mình
Đượ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à:
openclaw models list --provider openai- copy đúng tên model mini đang có
openclaw models set ...openclaw models statusđể check
Docs:
- Models CLI: https://docs.openclaw.ai/cli/models
- Models overview: https://docs.openclaw.ai/concepts/models
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.
change model openai codex
Nếu bạn muốn chuyển sang OpenAI Codex, làm như này:
- Đăng nhập Codex trước (nếu chưa có):
openclaw models auth login --provider openai-codex
- Xem các model Codex đang có
openclaw models list --provider openai-codex
- Đổi model mặc định
openclaw models set <model-trong-list>
- 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:
- OpenAI provider: https://docs.openclaw.ai/providers/openai
- Models CLI: https://docs.openclaw.ai/cli/models
Nếu bạn muốn, paste output của:
openclaw models list --provider openai-codex
mình chỉ luôn dòng nào nên chọn.
how to apply tavily api key
Easiest way:
- Get a key from https://tavily.com/
- Run:
openclaw configure --section web
- 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"
}
}
}
}
},
tools: {
web: {
search: {
provider: "tavily"
}
}
}
}
Docs:
- Tavily: https://docs.openclaw.ai/tools/tavily
- Web search setup: https://docs.openclaw.ai/tools/web
If you want, I can give you the exact steps for Windows, Ubuntu, or macOS.
chỉ mình cách nhập token telegram bằng lệnh openclaw
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:
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
Nếu muốn dùng env var thay vì lưu token trực tiếp:
export TELEGRAM_BOT_TOKEN="123456:ABC..."
và để OpenClaw dùng fallback đó cho account mặc định.
Docs:
- Telegram: https://docs.openclaw.ai/channels/telegram
- Config CLI: https://docs.openclaw.ai/cli/config
Nếu bạn muốn, mình có thể viết luôn bộ lệnh đầy đủ cho case:
- chỉ chat riêng, hoặc
- thêm bot vào group Telegram.
Gateway LaunchAgent was installed but not loaded; re-bootstrapped launchd service.
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
Nếu gateway status báo running/healthy thì thường là ổn rồi, không cần lo.
Nếu vẫn không chạy, paste output của 3 lệnh trên, mình xem tiếp cho.
Docs: https://docs.openclaw.ai/start/faq • https://docs.openclaw.ai/gateway/troubleshooting
chỉ mìh cách nhập openai codex api key
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:
- OpenAI: https://docs.openclaw.ai/providers/openai
- Configure: https://docs.openclaw.ai/cli/configure
Nếu muốn, mình có thể chỉ bạn đúng 1 trong 2 đường này:
- dùng Codex bằng đăng nhập tài khoản ChatGPT, hoặc
- dùng OpenAI API key
sk-....
unexpected status 401 Unauthorized: Incorrect API key provided: sk-your-****here. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9ee9d9afce53ab8e-YYZ, request id: req_7ea901c569f847288bf189ee1afa8e9b, auth error: 401, auth error code: invalid_api_key
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.
unexpected status 401 Unauthorized: Incorrect API key provided: sk-your-****here. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9eea1ca15b8fab36-YYZ, request id: req_0c636101639445cd99332d04413ad8d8, auth error: 401, auth error code: invalid_api_key
mình vẫn bị lỗi này là sao ta
Ừ, 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:
- Bạn vẫn còn để placeholder trong config / auth profile
- Bạn
export OPENAI_API_KEYtrong terminal nhưng gateway daemon không thấy - Bạn đang cấu hình nhầm giữa
openaivàopenai-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:
grep -R "sk-your-" ~/.openclaw 2>/dev/null
Nếu lệnh này ra kết quả, thì đúng là OpenClaw vẫn đang đọc key giả từ file cũ.
Lưu ý
Nếu bạn đang muốn dùng Codex thì route đó thường là:
openclaw models auth login --provider openai-codex
chứ không phải OpenAI API key thường.
Docs:
- Env loading: https://docs.openclaw.ai/help/environment
- OpenAI: https://docs.openclaw.ai/providers/openai
- Models status: https://docs.openclaw.ai/cli/models
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ả.
🦞 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
- openai-codex usage: 5h 100% left ⏱4h 59m · Week 48% left ⏱4d 12h
- openai-codex:default ok expires in 8d
- openai-codex:ryanle4995@gmail.com (ryanle4995@gmail.com) ok expires in 10d
như vậy đã được chưa
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-hereOPENROUTER_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:
- OpenAI/Codex: https://docs.openclaw.ai/providers/openai
- Models CLI: https://docs.openclaw.ai/cli/models
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.
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
- openai-codex usage: 5h 100% left ⏱4h 59m · Week 48% left ⏱4d 11h
- openai-codex:default ok expires in 8d
- openai-codex:ryanle4995@gmail.com (ryanle4995@gmail.com) ok expires in 10d
kiểm tra xem đc chưa @golden kraken
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 healthyopenai: 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 anthropic và openrouter, 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.
input teleegram token
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:
openclaw gateway status
Docs: https://docs.openclaw.ai/channels/telegram
If you want, I can also give you the full setup for:
- Telegram DM only, or
- Telegram group bot.
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
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:
openclaw gateway status
openclaw status
Nếu vẫn bị 1008: pairing required
Thường là client cũ đang xin thêm scope mới, nhất là operator.write.
Khi đó:
- chạy lại
openclaw devices list - approve request mới nhất
- thử reconnect lại
Docs:
- Troubleshooting: https://docs.openclaw.ai/gateway/troubleshooting
- Devices CLI: https://docs.openclaw.ai/cli/devices
- Dashboard 1008 notes: https://docs.openclaw.ai/web/dashboard#if-you-see-unauthorized-1008
Nếu bạn muốn, paste output của:
openclaw devices list
mình xem giúp request nào cần approve.
lệnh openclaw doctor và cách fix
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:
- FAQ: https://docs.openclaw.ai/help/faq
- Troubleshooting: https://docs.openclaw.ai/gateway/troubleshooting
Nếu muốn, paste output của:
openclaw doctor
mình sẽ đọc và chỉ bạn nên fix dòng nào.
Your AI assistant, now without the $3,499 headset.
│
gateway connect failed: GatewayClientRequestError: pairing required
◇
Error: gateway closed (1008): pairing required
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
Vì đôi khi đây là scope upgrade chứ không phải pairing mới hoàn toàn.
Docs:
- Troubleshooting: https://docs.openclaw.ai/gateway/troubleshooting
- Devices: https://docs.openclaw.ai/cli/devices
Nếu bạn paste output của:
openclaw devices list
mình chỉ luôn dòng nào cần approve.
hướng dẫn mình fully uninstall openclaw
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.
⚠️ ⏰ Cron: multica-project-loop failed
gateway connect failed: GatewayClientRequestError: pairing required roate liên tục làm sao fix được
Nếu nó bị pairing required lặp hoài, thường là 1 trong 2 kiểu:
- bạn approve requestId cũ
- 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ảidevices listlạ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>
Nếu vẫn chưa hết
Restart gateway rồi thử lại:
openclaw gateway restart
openclaw devices list
Và nếu nó vẫn stuck sau đó, có report là reboot cả máy mới clear được trạng thái kẹt này.
Docs:
- Devices CLI: https://docs.openclaw.ai/cli/devices
- Troubleshooting: https://docs.openclaw.ai/gateway/troubleshooting
Paste giúp mình output của:
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.
vẫn bị repair loop bug
Ừ, 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 --versionopenclaw gateway statusopenclaw 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.
🦞 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
Cái này cho thấy gateway đang chạy bình thường rồi nhé:
Runtime: runningRPC 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à:
openclaw devices list --json- 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.
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)
Đú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:
- có pending request không
- có 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
"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"
],
devices list/approvecó thể fallback localdevices removethì cần auth scope thật (operator.pairing/ admin), nên client đang bị loop sẽ không tự remove được
Docs:
- Devices CLI: https://docs.openclaw.ai/cli/devices
- Dashboard / 1008 auth notes: https://docs.openclaw.ai/web/dashboard#if-you-see-unauthorized-1008
Nếu bạn muốn, mình có thể viết cho bạn đúng nguyên bộ 3 lệnh theo kiểu copy-paste, chỉ cần thay token vào là chạy.
Ừ, đ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.
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
Đú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.approvalsoperator.adminoperator.readoperator.writeoperator.pairingoperator.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-deviceIdnew-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 statusopenclaw devices list --json- the
pairing requiredlog snippet
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.
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--tokenbị 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"