Skip to content

Handle relative paths for codecompanion tools#267

Merged
Davidyz merged 4 commits intomainfrom
fix/codecompanion_tool_rel_paths
Aug 11, 2025
Merged

Handle relative paths for codecompanion tools#267
Davidyz merged 4 commits intomainfrom
fix/codecompanion_tool_rel_paths

Conversation

@Davidyz
Copy link
Owner

@Davidyz Davidyz commented Aug 9, 2025

Closes #260

Since other tools in codecompanion.nvim are designed to avoid IO on files outside of cwd, this PR differentiate paths inside of cwd and outside of cwd by using relative paths for the former, and absolute paths for the later. Instructions are included in the query and files_ls tool schemas so that the model knows that they can't use the other tools on files represented by absolute paths.

Until the upstream rule of "no IO outside of cwd" is changed, this extension will stick to this rule when formatting the output.

@Davidyz Davidyz added bug Something isn't working fix labels Aug 9, 2025
@codecov
Copy link

codecov bot commented Aug 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (55b4d03) to head (e5e760b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #267   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          24       24           
  Lines        1775     1775           
=======================================
  Hits         1771     1771           
  Misses          4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Davidyz Davidyz marked this pull request as ready for review August 9, 2025 13:41
@Davidyz Davidyz merged commit cd79d07 into main Aug 11, 2025
15 checks passed
@Davidyz Davidyz deleted the fix/codecompanion_tool_rel_paths branch August 11, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] CodeCompanion tools should work with relative paths.

1 participant