mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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:
1 parent
93338abbdb
commit
91f37961e8
5 files changed
+84
-16
No files matched your search
@@ -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[] {
|
||||
|
||||
Reference in new issue
Block a user