Skip to content

Conversation

@bryanchen-d
Copy link
Contributor

Fixes #293503

Problem

LoggerChannelClient.deregisterLogger narrowed its parameter type to only URI, but the base interface ILoggerService.deregisterLogger accepts URI | string. Callers passing string logger IDs (e.g., MCP server passing this._loggerId) sent raw strings over IPC. On the main process, URI.revive(stringValue) treated the entire string as a URI scheme, which failed _validateUri with [UriError]: Scheme contains illegal characters.

This was the #1 unhandled error by volume: 1.4M hits, 567K affected users.

Fix

  1. Producer fix (src/vs/platform/log/common/logIpc.ts): Changed deregisterLogger to accept URI | string and call this.toResource(idOrResource) before sending over IPC — matching the pattern already used by setVisibility.

  2. Error enrichment (src/vs/base/common/uri.ts): Enhanced the _validateUri error message to include the actual invalid scheme value (truncated to 50 chars) and its length, so future telemetry from any call site reveals what data was passed.

LoggerChannelClient.deregisterLogger accepted only URI but the base
interface accepts URI | string. Callers passing string logger IDs
(e.g. mcpServer) sent raw strings over IPC, causing URI.revive to
treat the string as a scheme and fail validation.

Fix: accept URI | string and convert via toResource() before IPC,
matching the pattern already used by setVisibility.

Also enrich the _validateUri error message with the actual scheme
value for future telemetry diagnosis.
Copilot AI review requested due to automatic review settings February 9, 2026 20:10
@vs-code-engineering
Copy link

vs-code-engineering bot commented Feb 9, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/base/common/uri.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a high-volume unhandled error caused by LoggerChannelClient.deregisterLogger sending string logger IDs over IPC (where the main process attempted URI.revive(string) and failed URI validation). Also improves URI validation diagnostics and adds internal guidance for handling telemetry-driven error fixes.

Changes:

  • Widen LoggerChannelClient.deregisterLogger to accept URI | string and serialize via toResource(...) before IPC.
  • Enrich _validateUri’s “illegal scheme” error to include the invalid scheme value (truncated) and its length.
  • Add internal skill/prompt docs for investigating and fixing telemetry-reported unhandled errors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/vs/platform/log/common/logIpc.ts Fixes producer-side IPC payload for deregisterLogger by converting string IDs to a log file URI first.
src/vs/base/common/uri.ts Adds more diagnostic detail to URI scheme validation errors to aid future telemetry triage.
.github/skills/fix-errors/SKILL.md Adds internal guidelines for addressing unhandled error telemetry issues.
.github/prompts/fix-error.prompt.md Adds an agent prompt for the “fix unhandled error from telemetry” workflow.

@TylerLeonhardt
Copy link
Member

Adding @jrieken (owns URI) & @sandy081 (owns logger stuff) to make sure this is ok

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.

[Unhandled Error] [UriError]: Scheme contains illegal characters.

4 participants