-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add repos toolset instructions #1585
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: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds server instructions for the repos toolset to guide AI models to retrieve the file SHA before updating files, which should reduce "sha" wasn't supplied errors. The instruction tells models to call get_file_contents first to get the SHA, then use it in the create_or_update_file call.
Key changes:
- Added a new case for "repos" in the
getToolsetInstructionsswitch statement that provides guidance on the file update workflow
| case "repos": | ||
| return `## Repositories | ||
| Before updating an existing file, always call 'get_file_contents' to retrieve the SHA of the file blob. Use this SHA as the "sha" parameter in create_or_update_file tool call to avoid conflicts. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing article "the" before "create_or_update_file tool call". The phrase should read "in the create_or_update_file tool call" for grammatical correctness.
| Before updating an existing file, always call 'get_file_contents' to retrieve the SHA of the file blob. Use this SHA as the "sha" parameter in create_or_update_file tool call to avoid conflicts. | |
| Before updating an existing file, always call 'get_file_contents' to retrieve the SHA of the file blob. Use this SHA as the "sha" parameter in the create_or_update_file tool call to avoid conflicts. |
| return `## Repositories | ||
| Before updating an existing file, always call 'get_file_contents' to retrieve the SHA of the file blob. Use this SHA as the "sha" parameter in create_or_update_file tool call to avoid conflicts. | ||
| ` |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace (tabs) should be removed for consistency. Most other instruction blocks don't have trailing whitespace on their closing lines.
|
Nice addition! One thought on the blob SHA requirement: Since blob SHAs are deterministic (just Workflow:
This way the tool is useful in more scenarios - not just when you have a local git clone. The model can work entirely through GitHub API when needed. |
|
@SamMorrowDrums I'd prefer to go with simpler version first and look how it affected error rates. We can improve on it later |
Adds server instructions for
repostoolset that tells a model to retrieve file sha before updating it. This should help decrease the amount of"sha" wasn't supplied.errors.