-
Notifications
You must be signed in to change notification settings - Fork 207
Add system.fs_file_edit script for file splice operations with comprehensive benchmarks #1880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Co-authored-by: pelikhan <[email protected]>
@copilot rename tool to "fs_file_edit" |
Co-authored-by: pelikhan <[email protected]>
@copilot add genaiscript script in samples/sample that runs tests against file edit benchmarks |
…ions Co-authored-by: pelikhan <[email protected]>
Created Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Implements a new system script
system.fs_file_edit
that provides file editing capabilities through a splice operation, similar to JavaScript'sArray.splice()
but for file lines.What this adds
The new
fs_file_edit
tool allows AI agents to precisely edit files by:Usage
Implementation details
/packages/core/genaisrc/system.fs_file_edit.genai.mts
fs_file_edit
(follows established fs_ naming convention)filename
: Path relative to workspace rootinsertLine
: 1-based line number where to start the editdeleteCount
: Number of lines to delete (default: 0)lines
: Array of lines to insert (default: [])Testing & Benchmarks
fs-file-edit-benchmark.genai.mts
in samples/sample that provides comprehensive benchmarking with:The benchmark script demonstrates proper usage patterns and validates tool reliability across different file editing scenarios, making it easier for developers to understand and test the fs_file_edit capabilities.
This enables more precise file editing for AI agents compared to full file rewrites, making it easier to implement targeted code changes and content modifications.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.