#Claude cli
1 messages · Page 1 of 1 (latest)
That error is intentional. Claude Code wonât allow --dangerously-skip-permissions while running as root/via sudo, because that flag bypasses permission prompts and safety checks. Anthropic documents it as bypassPermissions mode and says to use it only in isolated environments like containers/VMs/devcontainers. (code.claude.com)
Fix is not to sudo harder â run Claude as a normal unprivileged user:
# bad
sudo claude --dangerously-skip-permissions
# good
claude --dangerously-skip-permissions
If this is on a VPS/container, create/use a non-root user, mount only the project directory, and run Claude there. If you just want fewer prompts, Claudeâs newer auto/sandbox modes are safer than full bypass. (anthropic.com)
Control whether Claude asks before editing files or running commands. Cycle modes with Shift+Tab in the CLI or use the mode selector in VS Code, Desktop, and claude.ai.
Comment changer ça car j'utilsie le cli dans openclaw et sa me dit c comme erreur
Oui â dans OpenClaw, ne mets pas sudo/root avec Claude CLI.
Ă faire :
- VĂ©rifie dâabord ta version :
openclaw --version
- Si tu as configuré/écrit une commande Claude comme ça :
claude --dangerously-skip-permissions ...
remplace par :
claude --permission-mode bypassPermissions --print "ta tĂąche"
- Si lâerreur vient du gateway OpenClaw, vĂ©rifie quâil ne tourne pas en root :
openclaw gateway status
openclaw status --all
- Si tu as mis des args custom dans
~/.openclaw/openclaw.json, cherche une config du genre :
agents: {
defaults: {
cliBackends: {
"claude-cli": {
args: ["--dangerously-skip-permissions"]
}
}
}
}
Supprime ce flag, ou remplace par --permission-mode bypassPermissions + --print.
Docs utiles : https://docs.openclaw.ai/gateway/cli-backends et https://docs.openclaw.ai/providers/anthropic
Si tu colles ici openclaw --version + la partie claude-cli de ta config, je peux te dire exactement quoi changer. đŠ
"anthropic:claude-cli": {
"provider": "claude-cli",
"mode": "oauth"
}
}
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
Ce bloc est OK â câest juste le profil dâauth Claude CLI. Ce nâest pas lui qui cause lâerreur.
Lâerreur vient plutĂŽt de lâun de ces deux cas :
-
OpenClaw/Gateway tourne en root ou via sudo
â Claude refuse le mode bypass en root. -
OpenClaw est en mode YOLO exec
(tools.exec.security: "full"+tools.exec.ask: "off")
â OpenClaw ajoute--permission-mode bypassPermissionspour Claude CLI.
à vérifier :
openclaw --version
openclaw gateway status
openclaw status --all
Et surtout : ne lance pas OpenClaw comme ça :
sudo openclaw gateway start
sudo openclaw ...
Lance-le avec ton utilisateur normal.
Si tu veux désactiver le bypass Claude, ajoute/force plutÎt un mode plus safe dans ~/.openclaw/openclaw.json :
{
agents: {
defaults: {
cliBackends: {
"claude-cli": {
args: ["--permission-mode", "acceptEdits"],
resumeArgs: ["--permission-mode", "acceptEdits"]
}
}
}
}
}
Mais avant de modifier, envoie openclaw --version + openclaw gateway status, parce que si ton gateway tourne en root, câest ça quâil faut corriger en premier.
Voilà , on a trouvé le problÚme :
"workspace": "/root/.openclaw/workspace"
Ăa veut dire que ton OpenClaw tourne/configure Claude CLI depuis root. Claude refuse le bypass permissions en root, donc lâerreur est normale.
Corrige comme ça :
- Ne lance pas OpenClaw avec
sudo - Utilise un utilisateur normal, pas
root - Mets le workspace hors de
/root, par exemple :
"workspace": "/home/TON_USER/.openclaw/workspace"
Ou supprime carrément la ligne workspace pour laisser OpenClaw utiliser le défaut de ton utilisateur.
Sur un VPS oĂč tu es connectĂ© en root, fais plutĂŽt :
adduser openclaw
su - openclaw
Puis réinstalle/configure OpenClaw + Claude CLI depuis cet utilisateur normal.
AprÚs ça :
claude auth login
openclaw models auth login --provider anthropic --method cli --set-default
openclaw gateway start
Ton bloc auth est OK. Le vrai problĂšme est /root. Docs : https://docs.openclaw.ai/gateway/cli-backends
c'est que openclaw je l'ai installer sur root
Oui, câest exactement la cause.
Claude CLI + bypass permissions ne peut pas tourner en root. Donc avec OpenClaw installé sous /root, tu vas continuer à avoir cette erreur.
Le fix propre :
- Crée/utilise un utilisateur normal sur ton VPS, par ex.
openclaw - Connecte-toi avec cet utilisateur
- Réinstalle OpenClaw + Claude CLI dans ce compte
- Relance lâonboarding/auth Claude CLI depuis ce compte
Exemple du flow :
# en root, créer un user normal
adduser openclaw
# passer sur ce user
su - openclaw
Puis dans ce user, refaire lâinstall OpenClaw, puis :
claude auth login
claude auth status --text
openclaw models auth login --provider anthropic --method cli --set-default
openclaw gateway start
Et dans ta config, le workspace ne doit plus ĂȘtre :
"/root/.openclaw/workspace"
mais plutĂŽt :
"/home/openclaw/.openclaw/workspace"
ou tu supprimes la ligne workspace.
Il y a pas une autre facon sans tout modif?
Oui, il y a un workaround sans tout réinstaller : rester en root, mais désactiver le mode bypass/YOLO.
Dans /root/.openclaw/openclaw.json, ajoute au niveau racine :
"tools": {
"exec": {
"ask": "on-miss"
}
}
Si tu as déjà un bloc tools.exec, change juste :
"ask": "off"
en :
"ask": "on-miss"
Puis redémarre :
openclaw gateway restart
Ăa Ă©vite quâOpenClaw ajoute --permission-mode bypassPermissions, donc Claude CLI ne devrait plus bloquer Ă cause de root.
â ïž Compromis : Claude/OpenClaw sera moins âauto full powerâ et pourra demander des validations. Si tu veux le mode bypass complet, lĂ non : Claude le bloque en root, il faut un utilisateur non-root.
je le met ou
Dans ton fichier config :
nano /root/.openclaw/openclaw.json
Mets le bloc au mĂȘme niveau que agents, pas dedans :
{
"agents": {
"defaults": {
...
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Si tu as déjà "tools" dans le fichier, ne le duplique pas : ajoute juste "exec" dedans.
Puis :
openclaw gateway restart
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
LĂ tu lâas mis au mauvais endroit : tu lâas mis au milieu de agents.defaults, avant "model". Il faut le dĂ©placer tout en bas, au mĂȘme niveau que "agents".
Structure correcte :
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Important : "tools" est aprĂšs la fermeture complĂšte de "agents".
Ensuite :
openclaw gateway restart
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Oui, ce bloc est bon si tu lâas mis tout Ă la fin du fichier, au mĂȘme niveau que "agents".
Il faut juste vérifier la virgule avant "tools" :
{
"agents": {
...
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Donc :
- aprĂšs le
}qui ferme"agents"â il faut une virgule, - aprĂšs le dernier bloc
"tools"â pas de virgule finale
Ensuite lance :
openclaw doctor
openclaw gateway restart
Si doctor ne signale pas dâerreur de JSON/config, câest bon.
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
},
"list": [
{
"id": "main",
"tools": {
etc
Presque â lĂ tu as mis "tools" dans "agents", et "list" se retrouve dehors. Il faut cette forme :
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6"
]
}
},
"list": [
{
"id": "main"
}
]
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Donc :
"defaults"et"list"sont dans"agents""tools"est en dehors de"agents"
â ïž Si dans agents.list[0].tools.exec tu as aussi "ask": "off", ça override le global. Mets-le aussi en "on-miss" ou supprime ce bloc.
Puis :
openclaw doctor
openclaw gateway restart
la je modif quoi:
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
},
"list": [
{
"id": "main",
"tools": {
"elevated": {
"enabled": true,
"allowFrom": {
"telegram": [
"IDD "
]
}
}
}
}
]
},
Modifie juste lâemplacement de "tools".
Actuellement tu as mis "tools" dans "agents". Il faut que "tools" soit aprĂšs tout le bloc "agents".
Fais comme ça :
{
"agents": {
"defaults": {
"workspace": "/root/.openclaw/workspace",
"models": {
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {},
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-5": {},
"claude-cli/claude-sonnet-4-5": {},
"claude-cli/claude-haiku-4-5": {}
},
"model": {
"primary": "claude-cli/claude-opus-4-7",
"fallbacks": [
"claude-cli/claude-sonnet-4-6",
"claude-cli/claude-opus-4-6",
"claude-cli/claude-opus-4-5",
"claude-cli/claude-sonnet-4-5",
"claude-cli/claude-haiku-4-5"
]
}
},
"list": [
{
"id": "main",
"tools": {
"elevated": {
"enabled": true,
"allowFrom": {
"telegram": ["IDD "]
}
}
}
}
]
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Résumé :
"defaults"â dans"agents""list"â dans"agents""tools": { "exec": ... }â en dehors de"agents"
AprĂšs sauvegarde :
openclaw doctor
openclaw gateway restart
Failed to read config at /root/.openclaw/openclaw.json SyntaxError: JSON5: invalid character '"' at 46:3
at syntaxError (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1055:12)
at Object.end (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:704:15)
at Object.default (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:168:37)
at lex (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.jsđŻ42)
at Object.parse (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:25:17)
at Object.loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19023:24)
at file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:56
at loadPinnedRuntimeConfig (file:///usr/lib/node_modules/openclaw/dist/runtime-snapshot-C5PRsFS9.js:67:17)
at loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:9) {
lineNumber: 46,
columnNumber: 3
Lâerreur dit : ligne 46, colonne 3 â tu as sĂ»rement fermĂ© } trop tĂŽt, puis "tools" arrive hors du JSON.
Fais afficher les lignes autour :
nl -ba /root/.openclaw/openclaw.json | sed -n '38,52p'
Ă corriger : avant "tools", tu dois avoir :
}
},
"tools": {
et pas :
}
}
"tools": {
En gros il faut une virgule entre la fin de agents et tools :
{
"agents": {
...
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Ouvre direct Ă la ligne 46 :
nano +46 /root/.openclaw/openclaw.json
Puis reteste :
openclaw doctor
Failed to read config at /root/.openclaw/openclaw.json SyntaxError: JSON5: invalid character ',' at 40:4
at syntaxError (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1055:12)
at Object.end (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:704:15)
at Object.default (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:168:37)
at lex (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.jsđŻ42)
at Object.parse (/usr/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:25:17)
at Object.loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19023:24)
at file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:56
at loadPinnedRuntimeConfig (file:///usr/lib/node_modules/openclaw/dist/runtime-snapshot-C5PRsFS9.js:67:17)
at loadConfig (file:///usr/lib/node_modules/openclaw/dist/io-Dv_xNAZB.js:19571:9) {
lineNumber: 40,
columnNumber: 4
}
La virgule est au mauvais endroit : tu as probablement fermĂ© le JSON complet avant dâajouter la virgule.
Fais ça pour quâon voie exactement :
nl -ba /root/.openclaw/openclaw.json | sed -n '34,46p'
Mais la forme doit ĂȘtre exactement :
{
"agents": {
"defaults": {
...
},
"list": [
...
]
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Important :
- aprĂšs
"defaults": { ... }â virgule, car"list"suit - aprĂšs
"list": [ ... ]â pas forcĂ©ment de virgule si câest le dernier dansagents
- aprĂšs le bloc
"agents"â virgule, car"tools"suit - aprĂšs le dernier
}du fichier â pas de virgule
Envoie les lignes 34â46 si tu veux, je te dis exactement quelle virgule enlever/dĂ©placer.
34 }
35 }
36 }
37 }
38 ]
39 }
40 },
41 "tools": {
42 "exec": {
43 "ask": "on-miss"
44 }
45 }
46 }
Tu es tout proche. LĂ , ligne 40 est en trop.
Remplace :
38 ]
39 }
40 },
41 "tools": {
par :
38 ]
39 },
40 "tools": {
Donc concrĂštement :
- supprime lâancien ligne 40
- mets la virgule directement aprĂšs le
}de la ligne 39
La fin doit ressembler à ça :
]
},
"tools": {
"exec": {
"ask": "on-miss"
}
}
}
Puis teste :
openclaw doctor
Si ça passe, fais :
openclaw gateway restart
1 {
2 "agents": {
3 "defaults": {
4 "workspace": "/root/.openclaw/workspace",
5 "models": {
6 "claude-cli/claude-opus-4-7": {},
7 "claude-cli/claude-sonnet-4-6": {},
8 "claude-cli/claude-opus-4-6": {},
9 "claude-cli/claude-opus-4-5": {},
10 "claude-cli/claude-sonnet-4-5": {},
11 "claude-cli/claude-haiku-4-5": {}
12 },
13 "model": {
14 "primary": "claude-cli/claude-opus-4-7",
15 "fallbacks": [
16 "claude-cli/claude-sonnet-4-6",
17 "claude-cli/claude-opus-4-6",
18 "claude-cli/claude-opus-4-5",
19 "claude-cli/claude-sonnet-4-5",
20 "claude-cli/claude-haiku-4-5"
21 ]
22 }
23 },
24 "list": [
25 {
26 "id": "main",
27 "tools": {
28 "elevated": {
29 "enabled": true,
30 "allowFrom": {
31 "telegram": [
32 "ID"
33 ]
34 }
35 }
36 }
37 }
38 ]
39 },
40 "tools": {
41 "exec": {
42 "ask": "on-miss"
43 }
44 }
45 },
46 "gateway": {
LĂ câest clair : ligne 45 ferme le fichier trop tĂŽt.
Comme tu as encore "gateway" aprĂšs, il faut remplacer la ligne 45 :
},
par juste :
},
Mais attention au niveau : la ligne 45 doit ĂȘtre une virgule aprĂšs le bloc tools, pas la fermeture finale du fichier.
La zone doit ĂȘtre :
"tools": {
"exec": {
"ask": "on-miss"
}
},
"gateway": {
Donc concrĂštement lignes 40â46 :
"tools": {
"exec": {
"ask": "on-miss"
}
},
"gateway": {
Pas de } supplémentaire entre tools et gateway.
AprÚs ça, reteste :
openclaw doctor
"tools": {
"exec": {
"ask": "on-miss"
}
},
Oui, ça câest bon si "gateway" vient juste aprĂšs :
"tools": {
"exec": {
"ask": "on-miss"
}
},
"gateway": {
...
}
Ensuite lance :
openclaw doctor
Sâil ne se plaint plus de JSON, fais :
openclaw gateway restart
Petit dĂ©tail : si gateway est le dernier gros bloc du fichier, lui nâaura probablement pas de virgule aprĂšs sa fermeture finale.
10:17:09+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=570
10:17:09+00:00 warn model-fallback/decision {"subsystem":"model-fallback/decision"} {"event":"model_fallback_decision","tags":["error_handling","model_fallback","candidate_failed"],"runId":"97d012d4-dd4f-4cb8-898d-b96f9efd1017","decision":"candidate_failed","requestedProvider":"claude-cli","requestedModel":"claude-sonnet-4-6","candidateProvider":"claude-cli","candidateModel":"claude-opus-4-7","attempt":6,"total":6,"reason":"unknown","errorPreview":"--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons","errorHash":"sha256:6619d78f7672","isPrimary":false,"requestedModelMatched":false,"fallbackConfigured":true} model fallback decision
10:17:09+00:00 error Embedded agent failed before reply: All models failed (6): claude-cli/claude-sonnet-4-6: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-6: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-sonnet-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-haiku-4-5: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | claude-cli/claude-opus-4-7: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons (unknown) | --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons
10:17:10+00:00 info gateway/channels/telegram {"subsystem":"gateway/channels/telegram"} telegram sendMessage ok chat=6484485569 message=3149
root@ubuntu-32gb-hel1-2-ai:~#
Ta config est maintenant lue, donc le JSON est mieux đ
Mais OpenClaw lance encore Claude en mode bypass. Fais ça avec openclaw config set plutÎt que modifier à la main :
openclaw config set tools.exec.ask on-miss
openclaw config set agents.list[0].tools.exec.ask on-miss
openclaw config validate
openclaw gateway restart
Puis teste.
Si ça Ă©choue encore, vĂ©rifie sâil reste le vieux flag quelque part :
grep -R "dangerously-skip-permissions" -n /root/.openclaw ~/.claude 2>/dev/null
openclaw --version
Envoie le rĂ©sultat de ces deux commandes si ça bloque encore. LĂ , soit un override agent garde ask: off, soit ta version OpenClaw utilise encore lâancien flag.
/root/.openclaw/plugin-runtime-deps/openclaw-2026.4.24-4eca5026e977/dist/extensions/anthropic/cli-shared.js:44:const CLAUDE_LEGACY_SKIP_PERMISSIONS_ARG = "--dangerously-skip-permissions";
/root/.claude/cache/changelog.md:1618:- Fixed MCP servers from .mcp.json not loading when using --dangerously-skip-permissions
/root/.claude/cache/changelog.md:1890:- Fixed hooks and plugins not executing when using --dangerously-skip-permissions flag
/root/.claude/cache/changelog.md:2529:- Fixed a bug where --dangerously-skip-permissions sometimes didn't work in --print mode
root@ubuntu-32gb-hel1-2-ai:~#
Ces rĂ©sultats grep sont normaux â ce nâest pas ta config qui contient le flag. LĂ il faut forcer Claude CLI Ă ne pas utiliser le mode bypass.
Lance ces commandes, ça évite de modifier le JSON à la main :
openclaw config set tools.exec.ask on-miss
openclaw config set agents.list[0].tools.exec.ask on-miss
openclaw config set agents.defaults.cliBackends.claude-cli.args '["-p","--output-format","stream-json","--include-partial-messages","--verbose","--setting-sources","user","--allowedTools","mcp__openclaw__*","--permission-mode","acceptEdits"]' --strict-json
openclaw config set agents.defaults.cliBackends.claude-cli.resumeArgs '["-p","--output-format","stream-json","--include-partial-messages","--verbose","--setting-sources","user","--allowedTools","mcp__openclaw__*","--permission-mode","acceptEdits","--resume","{sessionId}"]' --strict-json
openclaw config validate
openclaw gateway restart
Ăa force acceptEdits au lieu de bypassPermissions, donc Claude ne devrait plus bloquer Ă cause de root.
Si ça bloque encore aprÚs restart, envoie openclaw --version + la nouvelle erreur.
Error: Config validation failed: agents.defaults.cliBackends.claude-cli.command: Invalid input: expected string, received undefined
Yep, parce quâen crĂ©ant agents.defaults.cliBackends.claude-cli.*, OpenClaw veut aussi command.
Ajoute juste :
openclaw config set agents.defaults.cliBackends.claude-cli.command claude
Puis relance :
openclaw config validate
openclaw gateway restart
Si claude nâest pas dans le PATH du gateway, mets le chemin complet :
which claude
puis par exemple :
openclaw config set agents.defaults.cliBackends.claude-cli.command /usr/local/bin/claude
10:23:30+00:00 info - pid 2610580 root: openclaw-gateway (127.0.0.1:18789)
10:23:30+00:00 info - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
10:23:30+00:00 error Gateway restart timed out after 60s waiting for health checks.
10:23:30+00:00 info Tip: openclaw gateway status --deep
10:23:30+00:00 info Tip: openclaw doctor
10:23:56+00:00 warn plugins {"subsystem":"plugins"} bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
10:23:56+00:00 warn gateway/ws {"subsystem":"gateway/ws"} {"handshake":"pending","durationMs":2,"host":"127.0.0.1:18789","remoteAddr":"127.0.0.1","remotePort":36140,"localAddr":"127.0.0.1","localPort":18789,"endpoint":"127.0.0.1:36140->127.0.0.1:18789"} closed before connect conn=0c6e8762-510f-4afe-ba7a-c6a9d05da8fa peer=127.0.0.1:36140->127.0.0.1:18789 remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1006 reason=n/a
10:23:56+00:00 info plugins {"subsystem":"plugins"} embedded acpx runtime backend ready
Câest OK â lĂ le souci nâest plus JSON/Claude, câest juste que le gateway existant tourne encore, donc restart nâa pas rĂ©ussi Ă le remplacer.
Fais dans cet ordre :
openclaw config validate
openclaw gateway stop
openclaw gateway status
openclaw gateway start
openclaw gateway status --deep
Si openclaw gateway status dit encore quâun process tourne aprĂšs stop, ne force pas au hasard tout de suite â envoie la sortie de :
openclaw gateway status --deep
Ensuite, quand le gateway est bien redĂ©marrĂ©, reteste ton message Telegram/Claude. La config acceptEdits ne sera prise en compte quâaprĂšs un vrai stop/start.
Il répond plus ...
10:23:56+00:00 warn plugins {"subsystem":"plugins"} bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
10:23:56+00:00 warn gateway/ws {"subsystem":"gateway/ws"} {"handshake":"pending","durationMs":2,"host":"127.0.0.1:18789","remoteAddr":"127.0.0.1","remotePort":36140,"localAddr":"127.0.0.1","localPort":18789,"endpoint":"127.0.0.1:36140->127.0.0.1:18789"} closed before connect conn=0c6e8762-510f-4afe-ba7a-c6a9d05da8fa peer=127.0.0.1:36140->127.0.0.1:18789 remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1006 reason=n/a
10:23:56+00:00 info plugins {"subsystem":"plugins"} embedded acpx runtime backend ready
10:23:57+00:00 info plugins {"subsystem":"plugins"} bonjour: advertised gateway fqdn=ubuntu-32gb-hel1-2-ai (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=announcing
OK â les logs bonjour/ws closed before connect ne sont pas forcĂ©ment graves. LĂ il faut isoler Telegram vs Claude CLI.
Lance ça :
openclaw --version
openclaw status --all
openclaw channels status --probe
Puis teste Claude sans Telegram :
openclaw agent --message "Réponds juste OK" --model claude-cli/claude-sonnet-4-6
Si cette commande sort encore --dangerously-skip-permissions, lâoverride nâest pas appliquĂ©. Envoie alors :
openclaw config get tools.exec.ask
openclaw config get agents.list[0].tools.exec.ask
openclaw config get agents.defaults.cliBackends.claude-cli.args --json
Si la commande répond OK, alors Claude marche et le souci est cÎté Telegram/allowFrom. Dans ce cas :
openclaw channels logs --channel telegram
puis envoie un message au bot et regarde si OpenClaw voit lâinbound.
error: unknown option '--model'
Oui, ma faute â ta version de openclaw agent nâa pas --model.
Teste plutÎt avec le modÚle déjà configuré :
openclaw agent --agent main --message "Réponds juste OK"
Si ça ressort encore lâerreur Claude/root, envoie :
openclaw config get tools.exec.ask
openclaw config get agents.list[0].tools.exec.ask
openclaw config get agents.defaults.cliBackends.claude-cli.command
openclaw config get agents.defaults.cliBackends.claude-cli.args --json
Si ça répond OK, alors Claude remarche et le souci est cÎté Telegram. Dans ce cas :
openclaw channels status --probe
openclaw channels logs --channel telegram
đŠ OpenClaw 2026.4.24 (cbcfdf6) â Self-hosted, self-updating, self-aware (just kidding... unless?).
10:29:05 [plugins] telegram failed during register from /usr/lib/node_modules/openclaw/dist/extensions/telegram/index.js: Error: ENOTEMPTY: directory not empty, rmdir '/root/.openclaw/plugin-runtime-deps/openclaw-unknown-a44f41aef101/dist/extensions/node_modules/openclaw/plugin-sdk'
[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: telegram: Error: ENOTEMPTY: directory not empty, rmdir '/root/.openclaw/plugin-runtime-deps/openclaw-unknown-a44f41aef101/dist/extensions/node_modules/openclaw/plugin-sdk'
at maybeThrowOnPluginLoadError (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:2712:8)
at loadOpenClawPlugins (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:3588:3)
at resolveRuntimePluginRegistry (file:///usr/lib/node_modules/openclaw/dist/loader-NucjcOgv.js:2443:9)
at resolveOrLoadRuntimePluginRegistry (file:///usr/lib/node_modules/openclaw/dist/runtime-registry-loader-CO1cck7F.js:37:7)
at ensurePluginRegistryLoaded (file:///usr/lib/node_modules/openclaw/dist/runtime-registry-loader-CO1cck7F.js:68:2)
at ensureCliPluginRegistryLoaded (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:20:3)
at async ensureCliCommandBootstrap (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:47:2)
at async ensureCliExecutionBootstrap (file:///usr/lib/node_modules/openclaw/dist/command-execution-startup-Ch01qcCp.js:295:2)
at async Object.callback (file:///usr/lib/node_modules/openclaw/dist/program-C2pnmt5C.js:85:3)
at async Command.parseAsync (/usr/lib/node_modules/openclaw/node_modules/commander/lib/command.js:1122:5)
root@ubuntu-32gb-hel1-2-ai:~#
Ah, lĂ câest un autre bug : OpenClaw 2026.4.24 a un souci connu autour des plugin-runtime-deps / dossiers openclaw-unknown-*.
Fais le plus safe : stop + déplacer le cache, pas supprimer.
openclaw gateway stop
mv /root/.openclaw/plugin-runtime-deps /root/.openclaw/plugin-runtime-deps.bak.$(date +%s)
openclaw doctor
openclaw gateway start
Si doctor ou start retĂ©lĂ©charge/rĂ©pare les deps, câest normal.
Si ça recommence avec ENOTEMPTY, le mieux est de mettre à jour OpenClaw ou temporairement revenir à 2026.4.23 :
npm install -g openclaw@latest
# ou workaround temporaire :
npm install -g openclaw@2026.4.23
Puis :
openclaw gateway restart
Ce nâest plus ton problĂšme Claude/root pour lâinstant â le gateway/CLI plante avant, sur le chargement du plugin Telegram.
Gateway agent failed; falling back to embedded: GatewayClientRequestError: Error: Requested agent harness "claude-cli" is not registered and PI fallback is disabled.
Là ça confirme que le plugin/runtime Claude CLI nâest pas enregistrĂ© aprĂšs le souci plugin-runtime-deps.
Fais la rĂ©paration plugin dâabord :
openclaw gateway stop
openclaw doctor --fix
openclaw config validate
openclaw gateway start
Puis teste :
openclaw agent --agent main --message "Réponds juste OK"
Si tu as encore claude-cli is not registered, avec 2026.4.24 je te conseille franchement de rollback temporaire :
openclaw gateway stop
npm install -g openclaw@2026.4.23
openclaw doctor --fix
openclaw gateway start
2026.4.24 a lâair de toucher exactement le bug plugin-runtime-deps/openclaw-unknown-* que tu as vu. Une fois stable, on pourra revenir Ă latest.
10:34:27+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=352
10:34:27+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session reuse: provider=claude-cli model=claude-opus-4-7
10:34:29+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session turn: provider=claude-cli model=claude-opus-4-7 durationMs=1956 rawLines=13
10:36:52+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=opus promptChars=387
10:36:52+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session reuse: provider=claude-cli model=claude-opus-4-7
10:38:52+00:00 info typing TTL reached (2m); stopping typing indicator
10:38:57+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=125s queueDepth=1
10:39:27+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=155s queueDepth=1
Log tail truncated (increase --max-bytes).
root@ubuntu-32gb-hel1-2-ai:~#
Bonne nouvelle : le --dangerously-skip-permissions est rĂ©glĂ©. LĂ câest maintenant une session Claude CLI rĂ©utilisĂ©e qui reste bloquĂ©e :
claude live session reuse ...
stuck session ... processing
Fais un reset propre de la session live :
openclaw gateway stop
ps -ef | grep '[c]laude'
openclaw gateway start
Si tu vois encore un vieux process claude -p --output-format stream-json aprÚs gateway stop, tue juste celui-là , puis redémarre :
pkill -f 'claude.*--output-format.*stream-json'
openclaw gateway start
Ensuite, dans Telegram, envoie comme message seul :
/reset soft
Ăa drop les ids de session CLI rĂ©utilisĂ©s sans tout effacer. Docs : https://docs.openclaw.ai/tools/slash-commands
Si ça se rebloque souvent : honnĂȘtement, câest le root workaround qui montre ses limites. Le fix stable reste de lancer OpenClaw sous un user non-root.
10:58:57+00:00 warn model-fallback/decision {"subsystem":"model-fallback/decision"} {"event":"model_fallback_decision","tags":["error_handling","model_fallback","candidate_failed"],"runId":"5476e5c3-3f84-433c-a90f-3f303c0807bb","decision":"candidate_failed","requestedProvider":"anthropic","requestedModel":"claude-opus-4-7","candidateProvider":"anthropic","candidateModel":"claude-opus-4-7","attempt":1,"total":6,"reason":"timeout","status":408,"errorPreview":"CLI produced no output for 180s and was terminated.","errorHash":"sha256:8349e7990402","nextCandidateProvider":"anthropic","nextCandidateModel":"claude-sonnet-4-6","isPrimary":true,"requestedModelMatched":true,"fallbackConfigured":true} model fallback decision
10:58:57+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} cli exec: provider=claude-cli model=sonnet promptChars=350
10:58:57+00:00 info agent/cli-backend {"subsystem":"agent/cli-backend"} claude live session start: provider=claude-cli model=claude-sonnet-4-6 activeSessions=1
10:59:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=192s queueDepth=1
10:59:30+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=222s queueDepth=1
11:00:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=252s queueDepth=1
11:00:30+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=282s queueDepth=1
11:01:00+00:00 warn diagnostic {"subsystem":"diagnostic"} stuck session: sessionId=unknown sessionKey=agent:âŠ5569 state=processing age=312s queueDepth=1
LĂ on a atteint la limite du workaround root : Claude CLI dĂ©marre, mais comme on a dĂ©sactivĂ© bypassPermissions, il attend probablement une validation interactive â OpenClaw ne reçoit rien â timeout 180s.
Le fix stable : passer OpenClaw sur un user non-root. Tu peux migrer sans tout refaire :
# en root
openclaw gateway stop
adduser openclaw
rsync -a /root/.openclaw/ /home/openclaw/.openclaw/
chown -R openclaw:openclaw /home/openclaw/.openclaw
su - openclaw
Puis dans le user openclaw :
claude auth login
claude auth status --text
openclaw doctor --fix
openclaw gateway start
Et remets le mode normal/Yolo si tu veux :
openclaw config set tools.exec.ask off
openclaw config set agents.list[0].tools.exec.ask off
Alternative si tu veux absolument rester root : utilise une clĂ© API Anthropic au lieu de Claude CLI. Mais Claude CLI + root + non-interactif, ça va continuer Ă ĂȘtre fragile.
oui mais flemme de tout reinstaller đ
Je te comprends đ Mais bonne nouvelle : pas besoin de tout rĂ©installer. Tu peux juste migrer lâĂ©tat root vers un user normal.
Version âmoins reloueâ :
# en root
openclaw gateway stop
adduser openclaw
rsync -a --exclude plugin-runtime-deps /root/.openclaw/ /home/openclaw/.openclaw/
rsync -a /root/.claude/ /home/openclaw/.claude/ 2>/dev/null || true
chown -R openclaw:openclaw /home/openclaw/.openclaw /home/openclaw/.claude
loginctl enable-linger openclaw
su - openclaw
Puis dans le user openclaw :
openclaw config set agents.defaults.workspace /home/openclaw/.openclaw/workspace
openclaw config set tools.exec.ask off
openclaw config set agents.list[0].tools.exec.ask off
claude auth status --text
openclaw doctor --fix
openclaw gateway install --force
openclaw gateway start
Si claude auth status dit que tâes pas connectĂ© :
claude auth login
Câest pas une rĂ©install complĂšte : tu gardes ta config Telegram/OpenClaw, on change juste lâutilisateur qui exĂ©cute le gateway. Câest vraiment le chemin le moins douloureux pour que Claude CLI marche normalement.
â Claude Code successfully installed!
Version: 2.1.119
Location: ~/.local/bin/claude
Next: Run claude --help to get started
â Setup notes:
â Native installation exists but ~/.local/bin is not in your PATH. Run:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
â Installation complete!
openclaw@ubuntu-32gb-hel1-2-ai:~$
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude --help
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$ claude auth login
claude: command not found
openclaw@ubuntu-32gb-hel1-2-ai:~$
Tâes juste Ă lâĂ©tape PATH â Claude est installĂ©, mais le shell ne le trouve pas.
Fais dans le user openclaw :
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
hash -r
claude --help
Si ça marche, login :
claude auth login
claude auth status --text
Et pour que le gateway systemd trouve Claude mĂȘme sans .bashrc, force le chemin absolu :
openclaw config set agents.defaults.cliBackends.claude-cli.command /home/openclaw/.local/bin/claude
Important : enlĂšve aussi le workaround acceptEdits quâon avait mis quand tu Ă©tais root :
openclaw config unset agents.defaults.cliBackends.claude-cli.args
openclaw config unset agents.defaults.cliBackends.claude-cli.resumeArgs
openclaw config set tools.exec.ask off