diff --git a/lib/sandbox/manager.mjs b/lib/sandbox/manager.mjs index b1c8492..29faaec 100644 --- a/lib/sandbox/manager.mjs +++ b/lib/sandbox/manager.mjs @@ -125,6 +125,32 @@ export async function bootstrapSandbox(opts = {}) { : { active: false, reason: _initConfig?.failReason ?? 'sandbox not available' }; } + // OLP_SANDBOX_DISABLED env-var gate (2026-05-28 PR-B emergency disable): + // Live PI231 evidence showed that even with the exit-null guard, HTTP-path + // anthropic spawns produced no claude stdout when wrapped (manual exec of + // the SAME wrap script in the same process did produce output — root cause + // not yet isolated; likely interaction between SandboxManager in-process + // proxy sockets and OLP's request-handler event loop). Until the root cause + // is debugged + Suite 44-equivalent E2E tests cover the HTTP path, the + // sandbox bootstrap is opt-out via OLP_SANDBOX_DISABLED=1 in the server env. + // + // Default is sandbox-enabled (no env var = try-and-bootstrap). Sandbox is + // skipped only when the operator explicitly disables. + // + // Future PR-B follow-up: investigate the in-process proxy lifecycle + // interaction with OLP's HTTP server event loop; capture diagnostic + // transcript; ship Suite 44-equivalent that exercises the full HTTP + // request → sandbox spawn → response pipeline. + if (process.env.OLP_SANDBOX_DISABLED === '1') { + _initialized = true; + _active = false; + _initConfig = { failReason: 'OLP_SANDBOX_DISABLED=1 — sandbox bootstrap skipped by operator' }; + return { + active: false, + reason: 'OLP_SANDBOX_DISABLED=1 — sandbox bootstrap skipped by operator', + }; + } + // Reset state for re-bootstrap _initialized = false; _active = false;