Skip to content

chat: Suppress missing Agent Host file read logs#322200

Merged
roblourens merged 2 commits into
mainfrom
agents/error-handling-request-suppression-debate-fca321e5
Jun 20, 2026
Merged

chat: Suppress missing Agent Host file read logs#322200
roblourens merged 2 commits into
mainfrom
agents/error-handling-request-suppression-debate-fca321e5

Conversation

@roblourens

Copy link
Copy Markdown
Member

This suppresses expected Agent Host protocol error logs for missing file reads while preserving error propagation and warnings for unexpected failures.

What changed:

  • Skip protocol-client request-failed warnings for NotFound responses from file resource reads.
  • Skip protocol-server request-failed logs for the same missing file-read case.
  • Keep warnings for synthetic resource reads (for example session-db/git-blob), non-read NotFound errors, and non-missing read failures.
  • Map AgentService resourceRead failures more precisely so only actual missing files become NotFound.
  • Add focused coverage for client, server, and AgentService error mapping behavior.

Validation:

  • npm run typecheck-client
  • npm run gulp compile-client
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/electron-browser/remoteAgentHostProtocolClient.test.ts --run src/vs/platform/agentHost/test/node/agentService.test.ts --run src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts --grep "RemoteAgentHostProtocolClient|AgentService.*resourceRead|resourceRead"
  • node --experimental-strip-types build/hygiene.ts src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts src/vs/platform/agentHost/test/electron-browser/remoteAgentHostProtocolClient.test.ts src/vs/platform/agentHost/node/agentService.ts src/vs/platform/agentHost/test/node/agentService.test.ts src/vs/platform/agentHost/node/protocolServerHandler.ts src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts

(Written by Copilot)

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>
Copilot AI review requested due to automatic review settings June 20, 2026 04:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 resourceRead NotFound responses when the requested URI is a file: resource.
  • Suppress protocol-server error logs for the same expected missing-file resourceRead case.
  • Refine AgentService.resourceRead error 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

Comment thread src/vs/platform/agentHost/node/agentService.ts
Comment thread src/vs/platform/agentHost/node/protocolServerHandler.ts Outdated
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>
@roblourens roblourens marked this pull request as draft June 20, 2026 04:52
@roblourens roblourens marked this pull request as ready for review June 20, 2026 05:25
@roblourens roblourens enabled auto-merge (squash) June 20, 2026 05:25
@roblourens roblourens merged commit 06d84f5 into main Jun 20, 2026
28 checks passed
@roblourens roblourens deleted the agents/error-handling-request-suppression-debate-fca321e5 branch June 20, 2026 05:26
@vs-code-engineering vs-code-engineering Bot added this to the 1.126.0 milestone Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants