fix(sandbox): explicitly pass sandboxSessionKey to prevent Docker probes when mode is off (#73586)#73627
fix(sandbox): explicitly pass sandboxSessionKey to prevent Docker probes when mode is off (#73586)#73627PratikRai0101 wants to merge 13 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a regression where cron/heartbeat isolated sessions triggered Docker capability probes even when Confidence Score: 5/5Safe to merge — the fix is narrow, well-tested, and the only behavioral change is passing the correct session key to avoid spurious Docker probes. No P0 or P1 issues found. The getRuntimeConfig → loadConfig swap in context.ts is functionally identical (one calls the other). The sandboxSessionKey forwarding in run-executor.ts is the targeted fix, and the regression test directly exercises the failure mode. No files require special attention. The existing P2 note about runCliAgent not receiving sandboxSessionKey was flagged in a prior review cycle. Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/sandbox-off..." | Re-trigger Greptile |
|
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Keep this PR open. Current main still lacks the PR's central cron Best possible solution: Keep this PR open as the active implementation candidate for #73586. The maintainer path is to review the narrow What I checked:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6d323ee73640. |
|
@greptile-review |
|
Thanks @PratikRai0101 for jumping on this. Closing this PR as superseded rather than rejected. The linked issue #73586 is now fixed on main by PR #73671 plus the ClawSweeper follow-up #74520: Those landed fixes take a slightly different shape: current main guarantees |
Summary
agents.defaults.sandbox.modeis set to "off", isolated sessions (cron jobs, heartbeats) still trigger Docker capability probes (socket connection attempts and image inspections).src/cron/isolated-agent/run-executor.tsto explicitly passsandboxSessionKeyduringrunEmbeddedPiAgentcalls.2. Added an explicit
sandboxedstatus check at the top ofresolveSandboxContextinsrc/agents/sandbox/context.tsto ensure no backend initialization occurs if sandboxing is disabled.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
sandboxSessionKeywas not explicitly passed, causing the resolver to fall back to therunSessionId(a UUID). Because this UUID didn't match themainSessionKey, the logic incorrectly flagged the session as "non-main" and enabled sandboxing despite the global "off" setting.resolveSandboxContextlacked a high-level short-circuit to prevent backend factory resolution before validating thesandboxedstatus.Regression Test Plan (if applicable)
src/cron/isolated-agent/docker-probe.regression.test.tsresolveSandboxContextreturnsnullwithout throwing when mode is "off".User-visible / Behavior Changes
sandbox.mode: "off"will no longer see "failed to connect to docker API" errors in their gateway logs.Diagram (if applicable)