Skip to content

Cursor agents don't have write access? #11

@shaungaisie-mv

Description

@shaungaisie-mv

As a follow on from #7
I have noticed strange behaviour from the cursor agents, they don't have the ability to write from the directory it was opened in. Here are some snippets of the agent in build mode:

The file operations are being rejected. This might be because the workspace root is /Users/<user>/.config/opencode but the actual git repository is at /Users/<user>/git/... Let me check the workspace configuration and try using relative paths or a different approach.
Since I cannot create the file directly, let me provide you with the complete file content and the server actions that need to be added. You'll need to manually create the file.

So it has read access only? OC was definitely run from the correct directory. I also tried restarting my terminal before trying other opencode (free) models, which were able to read & write with no problems

I prompted more about the issue to get closer to the root of the issue.
It was telling me to create a workspace directory in my opencode config file but given the other models are able to work without this, it's made me think this is an issue with the plugin.

The operations are being rejected by opencode's security system. This suggests that opencode needs explicit permission to work outside its configured workspace directory. 
The core issue: OpenCode's workspace is set to ~/.config/opencode, but you're trying to work on files in /Users/user/git/... OpenCode is protecting you from accidentally modifying files outside the workspace.

FWIW, it was able to write to the location of the opencode.jsonc location but not to my default repo directory (which doesn't need any elevated privileges), despite other non-cursor models being able to do so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions