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
Non-git projects use "/" as worktree, breaking permission path resolution #24694
This issue might be a duplicate of existing issues. Please check:
Recent projects shows "/" when started in non-git directory #15719: Same root cause — Project.fromDirectory sets worktree: "/" for non-git directories instead of using the actual directory. That issue focuses on the UI symptom (recent projects showing "/"), but the fix would address the same underlying bug you're hitting.
If either of those captures your issue, please consider adding a comment there rather than opening a new one. If your report covers a distinct aspect not addressed in those issues, feel free to leave this open and clarify the difference.
Opened #26694 for this. Adds a workspaceRoot(ctx) helper next to containsPath (same file, same worktree === "/" sentinel) and uses it everywhere path.relative(instance.worktree, …) was anchoring on the worktree, including the file tools, tool/lsp.ts, and agent.ts's referencePath. Approach is similar to #18761 but consolidates the helper at the project layer rather than under tool/, and matches each test file's existing style instead of mixing patterns.
The PR for this was closed automatically. Commenting for attention to this since opencode should never automatically get full privileges of my systems root directory without the user explicitly giving it
Activity
github-actions commentedon Apr 28, 2026
This issue might be a duplicate of existing issues. Please check:
Project.fromDirectorysetsworktree: "/"for non-git directories instead of using the actual directory. That issue focuses on the UI symptom (recent projects showing "/"), but the fix would address the same underlying bug you're hitting.worktreebeing/in non-git projects, with the samepath.relative("/", ...)problem and similar suggested fix.If either of those captures your issue, please consider adding a comment there rather than opening a new one. If your report covers a distinct aspect not addressed in those issues, feel free to leave this open and clarify the difference.
BennD commentedon May 10, 2026
Opened #26694 for this. Adds a
workspaceRoot(ctx)helper next tocontainsPath(same file, sameworktree === "/"sentinel) and uses it everywherepath.relative(instance.worktree, …)was anchoring on the worktree, including the file tools,tool/lsp.ts, andagent.ts'sreferencePath. Approach is similar to #18761 but consolidates the helper at the project layer rather than undertool/, and matches each test file's existing style instead of mixing patterns.fix(permission): worktree-relative paths fall back to directory in no…
mattcoleanderson commentedon Jun 22, 2026
The PR for this was closed automatically. Commenting for attention to this since opencode should never automatically get full privileges of my systems root directory without the user explicitly giving it
github-actions commentedon Aug 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
dimon222 commentedon Aug 22, 2026
Reopen please, thus should never be fallback behavior
gwerbin commentedon Sep 4, 2026
+1, I was really surprised when I saw this. What can be done to help?