Problem
When an exec approval is triggered for a compound command starting with a shell builtin (e.g. cd deer-flow && ls), the user receives a standard approval prompt. Choosing allow-always returns ✅ Exec approval allowed always, but no pattern is actually persisted to the allowlist.
On the next attempt to run the same (or similar) command, the agent is blocked again and requests approval for the same command that was already "always allowed".
Root cause
allow-always resolves the approved binary's path (e.g. /usr/bin/ls → pattern /usr/bin/ls) and adds it to exec-approvals.json. But cd is a shell builtin — it has no resolved path. The allowlist entry is never created, yet the user receives a success confirmation.
Steps to reproduce
- Agent runs a compound command:
cd some-dir && ls
- Approval notification appears (because
cd doesn't match any allowlist pattern)
- User replies:
/approve <id> allow-always
- System responds:
✅ Exec approval allowed always
- Agent retries the same command → blocked again, requests approval
- Check
exec-approvals.json — no new entry was added
Expected behavior
Either:
- Persist a pattern that covers the builtin (e.g. allow the compound command), or
- Return an error/warning: "Cannot add shell builtin
cd to allowlist. Use allow-once instead."
The current silent success + no persistence is misleading.
Environment
- OpenClaw 2026.3.2
- Ubuntu Linux 6.8.0-100-generic
- Channel: Telegram
Problem
When an exec approval is triggered for a compound command starting with a shell builtin (e.g.
cd deer-flow && ls), the user receives a standard approval prompt. Choosingallow-alwaysreturns✅ Exec approval allowed always, but no pattern is actually persisted to the allowlist.On the next attempt to run the same (or similar) command, the agent is blocked again and requests approval for the same command that was already "always allowed".
Root cause
allow-alwaysresolves the approved binary's path (e.g./usr/bin/ls→ pattern/usr/bin/ls) and adds it toexec-approvals.json. Butcdis a shell builtin — it has no resolved path. The allowlist entry is never created, yet the user receives a success confirmation.Steps to reproduce
cd some-dir && lscddoesn't match any allowlist pattern)/approve <id> allow-always✅ Exec approval allowed alwaysexec-approvals.json— no new entry was addedExpected behavior
Either:
cdto allowlist. Useallow-onceinstead."The current silent success + no persistence is misleading.
Environment