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
Token optimization via temp files: I'm using on_tool_output callbacks to redirect large tool outputs to temporary files, returning only file paths and head/tail snippets to the LLM. The LLM should then be able to search these files using grep_search followed by segmented read_file.
Mono repo workflows: Our team works in a large mono repo, and we typically do out daily dev within a subproject directory. However, debugging sometimes requires searching dependency code in sibling subprojects outside the current working directory.
Searching Gitignored Directories
Generated code: Some projects generate code into ./target or ./build directories (gitignored). Searching these artifacts is useful during complex debugging sessions.
Development dependencies: When developing CodeCompanion extensions, I clone dependencies (including CodeCompanion) into ./deps (gitignored) for LSP and unit testing. Agents assisting with development need to search these dependencies to understand internal mechanisms.
Security Considerations
The current approval model tracks approvals per tool per chat buffer. With arbitrary search paths, "Always Accept" would grant overly broad access.
Solution: Path-Grouped Approvals
Extend the approval system to group approvals by path prefix:
When search_path is provided, check if that path (or a parent) has been approved. If not, prompt for approval with the specific path displayed. This ensures "Always Accept" applies only to the approved path scope.
Implementation Notes
Add optional search_path parameter to the schema; default to vim.fn.getcwd() when omitted
Paths specified explicitly to rg override ignore rules, so we don't need to another no_ignore parameter
Consider applying the same parameter to file_search for consistency
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Rationale
Searching External Directories
Token optimization via temp files: I'm using
on_tool_outputcallbacks to redirect large tool outputs to temporary files, returning only file paths and head/tail snippets to the LLM. The LLM should then be able to search these files usinggrep_searchfollowed by segmentedread_file.Mono repo workflows: Our team works in a large mono repo, and we typically do out daily dev within a subproject directory. However, debugging sometimes requires searching dependency code in sibling subprojects outside the current working directory.
Searching Gitignored Directories
Generated code: Some projects generate code into
./targetor./builddirectories (gitignored). Searching these artifacts is useful during complex debugging sessions.Development dependencies: When developing CodeCompanion extensions, I clone dependencies (including CodeCompanion) into
./deps(gitignored) for LSP and unit testing. Agents assisting with development need to search these dependencies to understand internal mechanisms.Security Considerations
The current approval model tracks approvals per tool per chat buffer. With arbitrary search paths, "Always Accept" would grant overly broad access.
Solution: Path-Grouped Approvals
Extend the approval system to group approvals by path prefix:
When
search_pathis provided, check if that path (or a parent) has been approved. If not, prompt for approval with the specific path displayed. This ensures "Always Accept" applies only to the approved path scope.Implementation Notes
search_pathparameter to the schema; default tovim.fn.getcwd()when omittedrgoverride ignore rules, so we don't need to anotherno_ignoreparameterfile_searchfor consistencyBeta Was this translation helpful? Give feedback.
All reactions