Skip to content

Conversation

@zerone0x
Copy link
Contributor

What does this PR do?

Fixes #8389

When Instance.worktree is "/" (non-git projects), the Session.plan() function was creating paths like /.opencode/plans/... at the system root, which fails with EACCES: permission denied, mkdir /.opencode.

This PR fixes the issue by using Instance.directory (the actual working directory) when worktree is "/" to create plan files in the correct location.

How did you verify your code works?

  • Code review of the fix logic
  • Verified the pattern matches similar handling in cli/cmd/agent.ts for global vs project scopes
  • Confirmed the typecheck error on @gitlab/gitlab-ai-provider is pre-existing in upstream/dev (unrelated to this change)

🤖 Generated with Claude Code

When Instance.worktree is "/" (non-git projects), the Session.plan()
function was creating paths like "/.opencode/plans/..." at the system
root, which fails with EACCES permission denied.

Now we use Instance.directory (the actual working directory) when
worktree is "/" to create plan files in the correct location.

Fixes anomalyco#8389

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EACCES: permission denied, mkdir /.opencode (errno -13) in Plan mode

1 participant