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

+4 -1
View File
@@ -150,7 +150,10 @@ export const getAssistantOpenCodeDir = () => path.join(getAssistantModePath(), A
export const getOpenCodeConfigHome = () => path.join(ENV.WORKSPACE.BASE_PATH, '.config')
export const getOpenCodeStateHome = () => path.join(ENV.WORKSPACE.BASE_PATH, '.opencode', 'state')
export const getOpenCodeGlobalSkillsPath = () => path.join(getOpenCodeConfigHome(), 'opencode', 'skills')
export const getOpenCodeToolOutputPath = () => path.join(getOpenCodeStateHome(), 'opencode', 'tool-output')
export const getOpenCodeDataPath = () => path.join(getOpenCodeStateHome(), 'opencode')
export const getOpenCodeToolOutputPath = () => path.join(getOpenCodeDataPath(), 'tool-output')
export const getOpenCodeWorktreesPath = () => path.join(getOpenCodeDataPath(), 'worktree')
export const getForgeWorktreesPath = () => path.join(getOpenCodeDataPath(), 'forge', 'worktrees')
export const getOpenCodeTmpHome = () => path.join(ENV.WORKSPACE.BASE_PATH, '.opencode', 'tmp')
export const getOpenCodeAgentTmpPath = () => path.join(getOpenCodeTmpHome(), 'opencode')
export const getConfigPath = () => path.join(ENV.WORKSPACE.BASE_PATH, ENV.WORKSPACE.CONFIG_DIR)