Description
When a GitHub MCP get_file_contents tool call returns a large file (50KB–999KB, under the MCP server's 1MB hard limit), VS Code's context window manager truncates the tool result before it reaches the LLM and marks the response isTruncated=true.
VS Code then displays the following hint to the agent/user:
"you can read the full contents of any truncated resources by passing their URIs as the absolutePath to the read_file tool"
The hint provides a vscode-chat-response-resource:// URI. However, passing this URI to read_file (VS Code's built-in file reading tool) does not work. It returns:
"File is outside of the workspace, and not open in an editor, and can't be read."
The hint instructs a recovery action that is impossible to perform. This causes AI agents to enter a confused state where they have been told a recovery path exists, attempt it, fail, and have no clear way forward.
Steps to Reproduce
- Open VS Code with the GitHub MCP server configured
- In Copilot Chat, use the
get_file_contents tool to fetch a file between 50KB and 999KB from a GitHub repository (e.g., a large C# utility file ~120KB)
- Observe that VS Code truncates the result and marks it
isTruncated=true
- Observe the hint displayed: "you can read the full contents of any truncated resources by passing their URIs as the absolutePath to the read_file tool" along with a
vscode-chat-response-resource://... URI
- Attempt to call
read_file with that URI as the absolutePath parameter
- Observe the error: "File is outside of the workspace, and not open in an editor, and can't be read."
Reproduction files used:
PQA_Training_Services.cs (~120KB) from PremierInc/pqa-browser-base-framework
Browser.Base.Framework.xml (~233KB) from same repo
Both triggered the truncation + broken hint on the same session.
Expected Behavior
Either:
- (a) The
vscode-chat-response-resource:// URI is readable via read_file, allowing the agent to retrieve the full content as the hint promises, OR
- (b) The hint is removed entirely and replaced with an honest message such as: "This file is too large to include in full. Use
search_code with specific search terms to find the content you need."
Actual Behavior
The hint is displayed but the suggested action is impossible. read_file with the URI returns an error. The agent has no actionable recovery path from the hint.
Additional Context
Copilot Chat Extension Version
- VS Code Version: 1.116.0
- OS Version: Windows_NT x64 10.0.26200
- Feature (e.g. agent/edit/ask mode): agent/ask
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): Claude Opus
- Logs:
Description
When a GitHub MCP
get_file_contentstool call returns a large file (50KB–999KB, under the MCP server's 1MB hard limit), VS Code's context window manager truncates the tool result before it reaches the LLM and marks the responseisTruncated=true.VS Code then displays the following hint to the agent/user:
The hint provides a
vscode-chat-response-resource://URI. However, passing this URI toread_file(VS Code's built-in file reading tool) does not work. It returns:The hint instructs a recovery action that is impossible to perform. This causes AI agents to enter a confused state where they have been told a recovery path exists, attempt it, fail, and have no clear way forward.
Steps to Reproduce
get_file_contentstool to fetch a file between 50KB and 999KB from a GitHub repository (e.g., a large C# utility file ~120KB)isTruncated=truevscode-chat-response-resource://...URIread_filewith that URI as theabsolutePathparameterReproduction files used:
PQA_Training_Services.cs(~120KB) fromPremierInc/pqa-browser-base-frameworkBrowser.Base.Framework.xml(~233KB) from same repoBoth triggered the truncation + broken hint on the same session.
Expected Behavior
Either:
vscode-chat-response-resource://URI is readable viaread_file, allowing the agent to retrieve the full content as the hint promises, ORsearch_codewith specific search terms to find the content you need."Actual Behavior
The hint is displayed but the suggested action is impossible.
read_filewith the URI returns an error. The agent has no actionable recovery path from the hint.Additional Context
vscode-chat-response-resource://) exists in VS Code internals but is not exposed as a readable file path to toolsCopilot Chat Extension Version