Skip to content

Symbolic link files within cwd cannot be added to context #336

@khaitranhq

Description

@khaitranhq

Description

I often to create a symbolic link from a folder in the spec repository to task folders. When attempting to add a file via mention syntax (e.g., @path/to/file), the system rejects files located within a symbolic link directory, even though the symbolic link itself is in the current working directory.

Expected behavior: Files accessible through a symbolic link in the current working directory should be allowed in context, since the symbolic link provides a valid path from the CWD.

Actual behavior: The system displays the error message: File not added to context. Must be inside current working directory.

Reproduction Steps

  1. Create a project directory:

    mkdir /tmp/project
  2. Create a folder outside the project with a test file:

    mkdir /tmp/linked_folder
    echo "test content" > /tmp/linked_folder/test.txt
  3. Create a symbolic link to the external folder inside the project:

    ln -s /tmp/linked_folder /tmp/project/linked_folder
  4. Open opencode.nvim with /tmp/project as the working directory

  5. Attempt to add the file using the mention syntax:

    @linked_folder/test.txt
    
  6. Observe the error: File not added to context. Must be inside current working directory.

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