Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in, per-agent-host IPC tracing to help diagnose missing/hidden agent-host events (e.g. hooks not appearing in debug logs) by logging all agent-host protocol traffic to dedicated Output channels.
Changes:
- Introduces
chat.agentHost.ipcLoggingEnabledsetting (Insiders-only) to enable IPC traffic logging. - Adds
LoggingAgentConnectionwrapper that logs calls/results/errors/events for anIAgentConnectionto an Output channel. - Switches both local agent host and remote agent host contributions to use the logging wrapper (and adjusts remote host parsing test coverage).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Registers new IPC logging configuration setting. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts | New logging wrapper that records IPC traffic into a dedicated Output channel. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts | Routes local agent-host traffic through LoggingAgentConnection and removes log-level-based output logic. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHost.contribution.ts | Routes remote agent-host traffic through LoggingAgentConnection with per-connection channel ids/labels. |
| src/vs/platform/agentHost/test/electron-browser/remoteAgentHostService.test.ts | Expands parsing test inputs to include “Agent host proxy listening …” log line format. |
| src/vs/platform/agentHost/common/agentService.ts | Adds exported setting id constant for IPC logging enablement. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts:114
- IPC logging currently records the full
authenticateparams/result payloads. That includes bearer tokens (token) and potentially other secrets, which can end up in the Output panel and be copied/shared. Please redact sensitive fields (at leasttoken/accessToken/refreshTokenand common auth headers) before writing to the output channel, or special-caseauthenticatelogging to avoid emitting the token value.
async authenticate(params: IAuthenticateParams): Promise<IAuthenticateResult> {
return this._logCall('authenticate', params, () => this._inner.authenticate(params));
}
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts:175
- Error logging in
_logCall/logErroronly recordserror.message, which often drops the stack and other useful context (andString(error)can become[object Object]). For debugging IPC issues, consider loggingerror.stackwhen available and otherwise using the same payload formatting/JSON logic as normal payloads so details aren’t lost.
logError(context: string, error: unknown): void {
this._log('!!', context, error instanceof Error ? error.message : String(error));
}
// ---- Internal helpers ---------------------------------------------------
private async _logCall<T>(method: string, params: unknown, fn: () => Promise<T>): Promise<T> {
this._log('>>', method, params);
try {
const result = await fn();
this._log('<<', method, result);
return result;
} catch (err) {
this._log('!!', method, err instanceof Error ? err.message : String(err));
throw err;
}
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts
Show resolved
Hide resolved
Co-authored-by: Copilot <copilot@github.com>
DonJayamanne
approved these changes
Mar 24, 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.
Co-authored-by: Copilot copilot@github.com