improve response/feedback loop with better error messages#1414
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves error messaging for the get_file_contents tool to better guide LLM users when they encounter the "file content SHA is nil" error. The enhanced message now explicitly instructs users to add a trailing slash (/) when requesting directories, addressing confusion that occurred when GPT-5.1-Codex ignored these instructions.
- Enhanced error message to include actionable guidance about trailing slashes for directory paths
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JoannaaKL
approved these changes
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GTP-5.1-Codex experienced a problem with
get_file_contents. It ignored the instruction to add trailing slashes to directories. It looped multiple times before it recovered and added the trailing slashes.The follow up error:
file content SHA is nilusually means we are using the logic to look for a file but provided a path in reality. This improved error message should improve the feedback loop drastically for llms.Closes: