Bug Description
runCronIsolatedAgentTurn in gateway-cli-*.js calls runEmbeddedPiAgent() without passing the bashElevated parameter. This causes elevated exec to always fail with:
elevated is not available right now (runtime=sandboxed).
Failing gates: enabled (tools.elevated.enabled / agents.list[].tools.elevated.enabled)
Root Cause
In src/cron/isolated-agent/run.ts (compiled to dist/gateway-cli-*.js), the call to runEmbeddedPiAgent() around line 3919 passes many parameters but omits bashElevated:
return runEmbeddedPiAgent({
sessionId: cronSession.sessionEntry.sessionId,
sessionKey: agentSessionKey,
// ... many params ...
disableMessageTool: deliveryRequested,
// bashElevated is MISSING here
abortSignal
});
Compare with the normal message handling path (in reply-*.js), which correctly resolves and passes bashElevated:
bashElevated: {
enabled: elevatedEnabled,
allowed: elevatedAllowed,
defaultLevel: resolvedElevatedLevel ?? "off"
},
Since bashElevated is undefined, runEmbeddedPiAgent passes it through to the exec tool where elevatedDefaults?.enabled evaluates to undefined (falsy), failing the enabled gate.
Expected Behavior
Isolated cron sessions should resolve elevated permissions via resolveElevatedPermissions() using the "cron-event" provider context, and pass the result as bashElevated to runEmbeddedPiAgent().
Suggested Fix
In runCronIsolatedAgentTurn, before the runEmbeddedPiAgent() call, resolve elevated:
const cronElevated = resolveElevatedPermissions({
cfg: cfgWithAgentDefaults,
agentId,
ctx: { Provider: 'cron-event', AccountId: '' },
provider: 'cron-event'
});
Then pass it:
return runEmbeddedPiAgent({
// ... existing params ...
bashElevated: {
enabled: cronElevated.enabled,
allowed: cronElevated.allowed,
defaultLevel: cfgWithAgentDefaults.agents?.defaults?.elevatedDefault || 'off'
},
abortSignal
});
Reproduction
- Configure
tools.elevated.enabled: true with appropriate allowFrom
- Create a cron job with
sessionTarget: "isolated" and payload.kind: "agentTurn"
- Have the cron job's prompt instruct the agent to use elevated exec
- Observe the elevated exec failure in logs
Environment
- OpenClaw version: 2026.2.25 (also confirmed not fixed in 2026.2.26 release notes)
- Platform: Linux arm64
- Sandbox mode: all
Bug Description
runCronIsolatedAgentTurningateway-cli-*.jscallsrunEmbeddedPiAgent()without passing thebashElevatedparameter. This causes elevated exec to always fail with:Root Cause
In
src/cron/isolated-agent/run.ts(compiled todist/gateway-cli-*.js), the call torunEmbeddedPiAgent()around line 3919 passes many parameters but omitsbashElevated:Compare with the normal message handling path (in
reply-*.js), which correctly resolves and passesbashElevated:Since
bashElevatedisundefined,runEmbeddedPiAgentpasses it through to the exec tool whereelevatedDefaults?.enabledevaluates toundefined(falsy), failing the enabled gate.Expected Behavior
Isolated cron sessions should resolve elevated permissions via
resolveElevatedPermissions()using the"cron-event"provider context, and pass the result asbashElevatedtorunEmbeddedPiAgent().Suggested Fix
In
runCronIsolatedAgentTurn, before therunEmbeddedPiAgent()call, resolve elevated:Then pass it:
Reproduction
tools.elevated.enabled: truewith appropriateallowFromsessionTarget: "isolated"andpayload.kind: "agentTurn"Environment