You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
external_directory permission triggered for .opencode/state within git worktree #7758
When running opencode from a subdirectory (e.g., packages/lib-relay in a monorepo), accessing .opencode/state/ at the project root triggers external_directory permission prompts—even though the path is within the git worktree.
Reproduction
cd~/Code/project/packages/some-package # subdirectory of git repo
opencode run --command some-command feature-name
# Prompts for external_directory permission to access:# /path/to/project/.opencode/state/feature-name
Paths within the git worktree but outside CWD are treated as external.
Expected Behavior
Paths within Instance.worktree (especially .opencode/ directories) should not trigger external_directory permission. Similar to how Truncate.DIR is auto-allowed in agent.ts:223.
Suggested Fix
Either:
Check containment against both Instance.directory and Instance.worktree
Auto-allow .opencode/** paths within the worktree (like Truncate.DIR)
Activity
github-actions commentedon Jan 11, 2026
This issue might be a duplicate of existing issues. Please check:
cwdoption tocreateOpencodeServer#3321: Addcwdoption tocreateOpencodeServer- Monorepo issue with subdirectory access to parent directoriesFeel free to ignore if none of these address your specific case.