fix(sandbox): accept OpenCode and forge worktrees as sandboxed project roots

The Manager sets XDG_DATA_HOME to <workspace>/.opencode/state, so OpenCode
workspace worktrees land at <data>/worktree and opencode-forge loop
worktrees at <data>/forge/worktrees. Neither was a project root, so an
enforced session in a forge worktree was refused with "working directory
is outside the sandboxed project roots". Both directories are now mounted
and accepted as working directories; their parents (auth.json, forge.db)
stay outside the guest.
This commit is contained in:
Chris Scott committed 2026-09-02 00:44:57 -04:00
1 parent 93338abbdb
commit 91f37961e8
5 files changed
+84 -16

No files matched your search

+3 -1
View File
@@ -3,9 +3,11 @@ import { accessSync, constants, realpathSync, statSync } from 'fs'
import { realpath } from 'fs/promises'
import {
ENV,
getForgeWorktreesPath,
getOpenCodeAgentTmpPath,
getOpenCodeGlobalSkillsPath,
getOpenCodeToolOutputPath,
getOpenCodeWorktreesPath,
getReposPath,
getScheduleWorktreesPath,
} from '@opencode-manager/shared/config/env'
@@ -153,7 +155,7 @@ export function buildSandboxVerifyProvisionArgs(): string[] {
}
export function sandboxProjectRoots(): string[] {
return [getReposPath(), getScheduleWorktreesPath()]
return [getReposPath(), getScheduleWorktreesPath(), getOpenCodeWorktreesPath(), getForgeWorktreesPath()]
}
export function sandboxMountRoots(): string[] {