-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
[Bug]: Isolated cron sessions cannot execute Python scripts in v2026.3.31 #58710
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
After upgrading to OpenClaw v2026.3.31, isolated cron sessions fail to execute Python subprocess calls with error: exec approval required but no approval client available. This is a regression from v2026.3.28 where cron jobs executed normally.
Steps to reproduce
- Create a cron job with isolated session that calls a Python script:
{
"schedule": { "kind": "every", "everyMs": 3600000 },
"payload": {
"kind": "agentTurn",
"message": "Run approval pipeline"
},
"sessionTarget": "isolated"
}- The isolated session attempts to execute:
subprocess.run(["python3", "tools/facebook-runner/daily_approval_runtime.py"])- Exec tool blocks with:
exec approval required but no approval client available
Expected behavior
Isolated cron sessions should execute Python subprocess calls without blocking, as they did in v2026.3.28. Alternatively, if approval enforcement is intentional, isolated sessions should have a mechanism to bypass approval (e.g., config flag, safeBins coverage for subprocess, or auto-approval mechanism).
Actual behavior
Isolated cron sessions unconditionally block on exec tool enforcement because:
- Session-level approval policy is independent of global
config.tools.execsettings - Isolated sessions spawn with reset policy (default: require approval)
ask: offandsecurity: fullonly suppress prompts, not enforcement- Isolated sessions have no approval client (interactive or automated)
- Result: Exec tool exits with "no approval client available"
OpenClaw version
2026.3.31
Operating system
macOS 26.4
Install method
npm
Model
anthropic/claude-sonnet-4-6
Provider / routing chain
openclaw->local->anthropic/claude-sonnet-4-6
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Root Cause Analysis
This appears to be a side effect of PR #57689 ("Agents/exec defaults: honor per-agent tools.exec defaults..."). While the change correctly enables tools.exec config enforcement, it does not account for isolated session contexts that lack approval clients.
Attempted Workarounds (All Failed)
- Global config
ask: off+security: full→ ignored by isolated sessions - Gateway restart (SIGUSR1) → session-level policy cache unaffected
safeBins: [python3, python]+safeBinTrustedDirs→ only whitelists bare binaries, not subprocess.run() invocations- Wrap subprocess in
sh -cshell → exec tool still enforces approval on shell wrapper before subprocess runs
Reproduction Details
- Cron jobs affected:
content-approval-daily,notebooklm-approval-daily(both isolated sessions) - Error context: Happens after 2026.3.31 upgrade; reverted to 2026.3.28 and jobs run successfully
- Partial workaround: Removing
tools.execconfig block entirely (reverting to pre-2026.3.31 default) allows cron to execute, but loses intentional exec policy enforcement
Proposed Solutions (in priority order)
-
Add
isolatedSessionPolicyconfig for cron/subagent jobs:{ "isolatedSessionPolicy": "bypass-approval" // or auto-approve with trusted-script whitelist }Allows explicitly trusted isolated jobs to bypass approval enforcement.
-
Extend safeBins whitelist to cover subprocess patterns:
Currently safeBins only whitelists bare binary invocations. Extend it to recognize trusted-subprocess patterns (e.g.,python3 /path/to/trusted/script.py). -
Add approval delegation mechanism for isolated sessions:
Isolated sessions can request approval from parent/main session via IPC/event, enabling human-in-the-loop without blocking on approval-client availability.
Impact
- Severity: High (blocks all isolated cron automation)
- Affected Users: Anyone using cron jobs with isolated sessions (subagent, ACP, background tasks)
- Workaround Available: Yes (downgrade to 2026.3.28 or remove
tools.execconfig)
Additional Context
Related to recent changes in exec approval handling:
- PR fix(auto-reply): thread per-agent tools.exec defaults into reply directives #57689: Agents/exec defaults
- PR fix(gateway): require node pairing before enabling node commands #57777: Gateway/node commands (node pairing approval)
- PR Gateway: harden node event trust boundaries #57691: Gateway/node events (reduced trusted surface)
All three PRs tightened approval enforcement, but none explicitly addressed isolated session contexts lacking approval clients.
Tags
bug exec cron isolated-sessions regression approval