Conversation
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. | ||
| ` |
There was a problem hiding this comment.
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 |
|
Re-done in #1621 |
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.