-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Background
The Copilot SDK v0.1.30 (released March 3, 2026) adds support for overriding built-in tools like grep, edit_file, or read_file, implemented by Steve Sanderson in commit f843c80.
This feature allows applications to customize how Copilot agents interact with files and code, enabling domain-specific optimizations and constraints.
Proposal
Leverage tool overriding to implement Planeteer-specific file operation constraints and workspace scoping:
-
Override
edit_filetool to:- Enforce that agents only edit files within the current working directory
- Prevent accidental modification of system files or directories outside the project
- Add pre/post-edit validation hooks (e.g., syntax checking, formatting)
- Log all file modifications for audit trail in the Execute screen
-
Override
read_filetool to:- Implement intelligent file size limits (warn/truncate for files >100KB)
- Cache frequently-read files to reduce redundant operations
- Track which files each task has accessed for dependency inference
-
Override
greptool to:- Scope searches to project-relevant directories (exclude
node_modules,.git, etc.) - Add search result caching for repeated queries
- Provide more context lines by default for better agent understanding
- Scope searches to project-relevant directories (exclude
-
Configuration in Settings - Add
.planeteer/config.jsonto allow users to enable/disable overrides or customize behavior
Benefit
- Safety: Prevent agents from accidentally modifying files outside the project workspace
- Performance: Caching and scoping reduce redundant operations and improve execution speed
- Observability: Better logging and tracking of tool usage during execution
- Customization: Users can tailor tool behavior to their project requirements
Acceptance Criteria
-
src/services/copilot.tsregisters custom tool overrides withoverridesBuiltInTool: trueflag -
edit_fileoverride validates paths are withinprocess.cwd()before executing -
read_fileoverride implements size limits and caching logic -
grepoverride excludes common ignore patterns (node_modules,.git, etc.) - Settings file
.planeteer/config.jsonallows enabling/disabling overrides - Execute screen displays tool usage statistics (reads, edits, greps per task)
- Tests in
src/services/copilot.test.tsverify override behavior - Documentation in README explains tool overrides and configuration options
AI generated by Weekly Enhancement Suggestions
Reactions are currently unavailable