Skip to content

Fix agent host telemetry log collision to prevent rotation failures - #334870

Open
Benjamin Christopher Simmonds (benibenj) wants to merge 1 commit into
mainfrom
agents/log-analysis-error-fix-prioritization-aae2a6b6
Open

Fix agent host telemetry log collision to prevent rotation failures#334870
Benjamin Christopher Simmonds (benibenj) wants to merge 1 commit into
mainfrom
agents/log-analysis-error-fix-prioritization-aae2a6b6

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

This pull request addresses a critical issue with telemetry log rotation failures in the Agent Host due to a file collision.

Changes Made

  • Updated the agentHostTelemetryService.ts to write telemetry diagnostics to a new log file named agentHostTelemetry.log, preventing conflicts with the main process's telemetry.log.
  • Modified the telemetryLogAppender.ts to support an explicit logger ID while maintaining compatibility with existing callers.
  • Added a regression test in telemetryLogAppender.test.ts to ensure the new logging behavior is validated.

Validation

  • All TypeScript type-checks and tests for both TelemetryLogAdapter and AgentHostTelemetryService passed successfully.
  • This fix resolves the issue of multiple processes attempting to rotate the same log file, which was causing permission errors in recent Insiders logs.

Other potential issues related to agenthost.log rotation failures and extension-host warnings were identified but not addressed in this PR, as their root causes were not clear enough for a safe fix.

Copilot AI balanced review requested due to automatic review settings September 7, 2026 09:07

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.

Copilot review overview

🟢 Approval recommended

The focused change preserves existing behavior while eliminating the identified log-file collision.

Review tier: Balanced
Findings: None

What changed in this PR

Separates Agent Host telemetry diagnostics from the main telemetry log to prevent cross-process rotation collisions.

Changes:

  • Adds configurable logger IDs while preserving existing callers.
  • Uses agentHostTelemetry.log for Agent Host telemetry.
  • Adds regression coverage for custom logger IDs.
File Description
src/​vs/​platform/​telemetry/​common/​telemetryLogAppender.ts Supports an explicit logger ID.
src/​vs/​platform/​agentHost/​node/​agentHostTelemetryService.ts Selects the Agent Host-specific telemetry log.
src/​vs/​platform/​telemetry/​test/​common/​telemetryLogAppender.test.ts Verifies custom logger-ID selection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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