chat: Suppress missing Agent Host file read logs#322200
Merged
roblourens merged 2 commits intoJun 20, 2026
Merged
Conversation
Suppress expected NotFound logging for file resource reads on both protocol client and server handling paths, while preserving warnings for synthetic resources, non-read requests, and non-missing read failures. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces log noise in the Agent Host protocol stack by suppressing expected NotFound warnings/errors for missing file resourceRead requests, while keeping error propagation and preserving logging for other NotFound cases (e.g. synthetic schemes like session-db:) and unexpected failures. It also refines AgentService.resourceRead error mapping so only actual missing files become NotFound, and adds targeted unit coverage for these behaviors.
Changes:
- Suppress protocol-client warnings for
resourceReadNotFoundresponses when the requested URI is afile:resource. - Suppress protocol-server error logs for the same expected missing-file
resourceReadcase. - Refine
AgentService.resourceReaderror mapping (missing vs permission vs other failures) and add focused tests across client/server/service.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts | Tracks per-request suppression metadata to avoid warning logs for missing file: reads while still surfacing the error to callers. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Adds server-side filtering to avoid error logging for expected missing file: reads that return NotFound. |
| src/vs/platform/agentHost/node/agentService.ts | Improves resourceRead error mapping so only true missing files map to NotFound (and permission issues map to PermissionDenied). |
| src/vs/platform/agentHost/test/electron-browser/remoteAgentHostProtocolClient.test.ts | Adds coverage ensuring only missing file: reads suppress warnings (other NotFound cases still warn). |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Adds coverage for AgentService.resourceRead error mapping (missing vs non-missing failures). |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Adds coverage ensuring the server does not log for missing file: reads but still logs for other missing-resource reads. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 2
Share missing file-read log suppression logic across protocol client and server paths, and avoid assuming read failures are always Error instances. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmitrivMS
approved these changes
Jun 20, 2026
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.
This suppresses expected Agent Host protocol error logs for missing file reads while preserving error propagation and warnings for unexpected failures.
What changed:
Validation:
(Written by Copilot)