Files
olp/lib
taodengandClaude Opus 4.7 b1e24b7cb0 fix(sandbox): add OLP_SANDBOX_DISABLED=1 env-var emergency disable
PR-B PI231 live verification surfaced a hard problem: HTTP-path anthropic
spawns produce no claude stdout when sandbox-wrapped, while manual exec
of the identical wrap script in the same node process DOES produce output.
Root cause not yet isolated — likely interaction between SandboxManager's
in-process proxy sockets (HTTP/SOCKS Unix sockets in /tmp) and OLP's
HTTP request-handler event loop.

Until the root cause is debugged and Suite 44-equivalent E2E tests cover
the full HTTP request → sandbox spawn → response pipeline, this commit
adds an env-var emergency disable: OLP_SANDBOX_DISABLED=1 in the server
environment causes bootstrapSandbox() to short-circuit immediately,
returning { active: false, reason: '...' }. Provider plugins continue
to spawn unsandboxed (matching pre-PR-B behavior).

Default remains sandbox-enabled. Only operators with broken HTTP-path
sandbox should set the env var (which is everyone on PI231 today,
until follow-up debugging completes).

Operational follow-up (PI231 right now):
  setsid env ... OLP_SANDBOX_DISABLED=1 node ~/olp/server.mjs ...
  → /health.sandbox.active=false
  → HTTP requests resume working

Future PR-B follow-up issues:
  1. Reproduce HTTP-path sandbox spawn failure in unit test
  2. Investigate in-process proxy lifecycle vs HTTP handler event loop
  3. Possibly: switch to per-spawn SandboxManager.initialize() lifecycle
  4. Re-enable sandbox by default after fix + Suite 44 HTTP-path coverage

Sandbox doctor (PR-A) unchanged. ADR 0014 unchanged (the disable is a
runtime gate, not a contract change). Suite 44 negative tests still
pass when enabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 17:52:07 +10:00
..