Sandbox OMO_MEMORY_HOME in isolatedChildEnv

Merged
DR
1mo ago
+46-2

Summary

Fixes #9239.

isolatedChildEnv sandboxed the agent dir and XDG_CONFIG_HOME but left OMO_MEMORY_HOME alone, so the child's memory component still used the caller's real ~/.omo/memory (or its override), and the transient sweep ran against it. The helper now sets OMO_MEMORY_HOME to a memory directory beside the sandbox agent dir, with a test for it.

Changes

  • sandbox-child-env.mjs: set OMO_MEMORY_HOME inside the sandbox.
  • sandbox-child-env.test.mjs: assert the child env never points at the caller's memory root.

QA & Evidence

  • What was tested: sandbox-child-env.test.mjs
    Observed result: against the unfixed source, 2 passed, 2 failed; with the fix, 4 passed, 0 failed.
    Why sufficient: the failing cases are the new memory-root assertions.

Risks & Residuals

  • bun run typecheck and the full bun test were not run, so they are unticked.

Automated Checks

  • bun run typecheck
  • bun test

Screenshots

Not applicable.

Related Issues

Closes #9239


Summary by cubic

Sandboxes OMO_MEMORY_HOME in isolatedChildEnv so QA children no longer read or write the caller's real ~/.omo/memory (or its override), which the transient sweep previously ran against.

  • Points OMO_MEMORY_HOME at a memory directory beside the sandbox agent dir.
  • Adds a unit test asserting the child's memory root stays inside the sandbox.
  • Model-profile e2e now fails the run if a scenario's child resolves a memory root outside the sandbox or its output names the caller's real memory root.

Closes #9239.