Skip to content

Add action to report GitHub Copilot Chat issues with output channel contents#287014

Merged
bpasero merged 9 commits intomainfrom
copilot/register-chat-output-issue-reporter
Jan 12, 2026
Merged

Add action to report GitHub Copilot Chat issues with output channel contents#287014
bpasero merged 9 commits intomainfrom
copilot/register-chat-output-issue-reporter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 11, 2026

Adds workbench.action.chat.reportIssueWithOutput command to capture output channel contents and pre-populate the issue reporter.

Implementation

  • New ReportChatIssueWithOutputAction in chatSetupContributions.ts
  • Uses ITextModelService.createModelReference(channel.uri) to safely read output channel content via public API
  • Attempts to retrieve GitHub Copilot Chat output channel, falls back to Window output channel (rendererLog) if unavailable
  • Accepts optional issueTitle and issueBody parameters that are passed through to the issue reporter
  • Pre-fills issue reporter data field with output channel contents or inlined localized fallback message
  • Gated on ChatContextKeys.enabled and ChatContextKeys.Setup.installed
  • Output channel ID extracted to defaultChat constant

Usage

// Basic usage via F1 command palette
F1 > "Report GitHub Copilot Chat Issue"

// Programmatic usage with optional parameters
await commandService.executeCommand('workbench.action.chat.reportIssueWithOutput');

// With custom title and body
await commandService.executeCommand('workbench.action.chat.reportIssueWithOutput', {
  issueTitle: 'Custom Issue Title',
  issueBody: 'Custom issue description'
});

Opens issue reporter with:

  • GitHub Copilot Chat extension pre-selected
  • Output channel contents (GitHub Copilot Chat or Window) in additional data field
  • Optional pre-populated issue title and body
  • Diagnostic logging for troubleshooting
Original prompt

Register another action around the chatSetup code that will grab the contents of GitHub Copilot Chat Output Channel and open the issue reporter with the contents as additional information


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Jan 11, 2026
Copilot AI and others added 4 commits January 11, 2026 16:47
…t channel contents

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
…enhance fallback message

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
… fallback message constant

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to open issue reporter with chat output Add action to report GitHub Copilot Chat issues with output channel contents Jan 11, 2026
Copilot AI requested a review from TylerLeonhardt January 11, 2026 17:04
@TylerLeonhardt
Copy link
Copy Markdown
Member

@copilot if the GitHub Copilot Chat output channel is not available, can you attach the Window output channel?

Also, can you allow the issue title and body (not data) to be passed in and plumbed through?

…dy parameters

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot if the GitHub Copilot Chat output channel is not available, can you attach the Window output channel?

Also, can you allow the issue title and body (not data) to be passed in and plumbed thro...

Done in commit 9b51a84:

  • Falls back to Window output channel (rendererLog) when GitHub Copilot Chat output channel is not available
  • Added optional options parameter with issueTitle and issueBody fields that are passed through to the issue reporter

Usage example:

// With default behavior
await commandService.executeCommand('workbench.action.chat.reportIssueWithOutput');

// With custom title and body
await commandService.executeCommand('workbench.action.chat.reportIssueWithOutput', {
  issueTitle: 'Custom Issue Title',
  issueBody: 'Custom issue description'
});

Comment thread src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.ts Outdated
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copy link
Copy Markdown
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

Example issue: #287023

@bpasero bpasero self-requested a review January 11, 2026 19:12
@bpasero bpasero marked this pull request as ready for review January 12, 2026 11:36
Copilot AI review requested due to automatic review settings January 12, 2026 11:36
@bpasero bpasero added this to the January 2026 milestone Jan 12, 2026
@bpasero bpasero self-assigned this Jan 12, 2026
@bpasero bpasero merged commit 6de24da into main Jan 12, 2026
25 of 26 checks passed
@bpasero bpasero deleted the copilot/register-chat-output-issue-reporter branch January 12, 2026 11:45
Copy link
Copy Markdown
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

This PR adds a new command workbench.action.chat.reportIssueWithOutput to capture GitHub Copilot Chat output channel contents and pre-populate the issue reporter. The purpose is to make it easier for users to report issues with GitHub Copilot Chat by automatically including diagnostic output channel information.

Changes:

  • Added chatExtensionOutputId field to the product configuration to identify the GitHub Copilot Chat output channel
  • Implemented command to retrieve output channel contents and open the issue reporter with the data
  • Added a "Report Issue" button that appears when chat setup fails or times out

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
product.json Adds chatExtensionOutputId field to configure the GitHub Copilot Chat output channel ID
src/vs/base/common/product.ts Adds chatExtensionOutputId property to the IDefaultChatAgent interface
src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.ts Implements command registration, output channel retrieval logic, issue reporter integration, and adds a "Report Issue" button to the setup agent progress UI
Comments suppressed due to low confidence (4)

src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.ts:192

  • This action is being added to SetupAgent but should be a standalone action in chatSetupContributions.ts. The PR description explicitly mentions "New ReportChatIssueWithOutputAction in chatSetupContributions.ts". Additionally, this creates unnecessary coupling between the SetupAgent class (which is for chat setup agents) and the issue reporting functionality.

		this.registerCommands();
	}

src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.ts:209

  • The hardcoded string 'rendererLog' should use the windowLogId constant from 'src/vs/workbench/services/log/common/logConstants.ts' instead. According to coding guideline 1000000, "Do not duplicate code. Always look for existing utility functions, helpers, or patterns in the codebase before implementing new functionality." This constant is the canonical identifier for the Window output channel and should be reused here.
				channel = outputService.getChannel('rendererLog');

src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.ts:376

  • The command button shown in the progress response is only displayed when chat setup fails or takes too long. However, the command is registered unconditionally and could be invoked at any time (e.g., via F1 command palette if properly registered). The command should work correctly in all contexts, not just during setup failures. Consider whether the hardcoded title and body make sense for general usage.
					progress({
						kind: 'command',
						command: {
							id: SetupAgent.CHAT_REPORT_ISSUE_WITH_OUTPUT_ID,
							title: localize('reportChatIssue', "Report Issue"),
						}
					});

src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.ts:195

  • According to custom coding guideline 1000002, "When adding a new chat/AI feature... these features must not show up for users when they've disabled AI features. The best way to do this is to gate the feature on the context key ChatContextKeys.enabled via a when clause." Since this is a CommandsRegistry registration rather than an Action2, it cannot use when clauses. This is another reason why this should be implemented as an Action2 in chatSetupContributions.ts where proper gating can be applied via precondition.
		this._register(CommandsRegistry.registerCommand(SetupAgent.CHAT_REPORT_ISSUE_WITH_OUTPUT_ID, async accessor => {

Comment on lines +195 to +236
this._register(CommandsRegistry.registerCommand(SetupAgent.CHAT_REPORT_ISSUE_WITH_OUTPUT_ID, async accessor => {
const outputService = accessor.get(IOutputService);
const textModelService = accessor.get(ITextModelService);
const issueService = accessor.get(IWorkbenchIssueService);
const logService = accessor.get(ILogService);

let outputData = '';
let channelName = '';

let channel = outputService.getChannel(defaultChat.outputChannelId);
if (channel) {
channelName = defaultChat.outputChannelId;
} else {
logService.warn(`[chat setup] Output channel '${defaultChat.outputChannelId}' not found, falling back to Window output channel`);
channel = outputService.getChannel('rendererLog');
channelName = 'Window';
}

if (channel) {
try {
const model = await textModelService.createModelReference(channel.uri);
try {
const rawOutput = model.object.textEditorModel.getValue();
outputData = `<details>\n<summary>GitHub Copilot Chat Output (${channelName})</summary>\n\n\`\`\`\n${rawOutput}\n\`\`\`\n</details>`;
logService.info(`[chat setup] Retrieved ${rawOutput.length} characters from ${channelName} output channel`);
} finally {
model.dispose();
}
} catch (error) {
logService.error(`[chat setup] Failed to retrieve output channel content: ${error}`);
}
} else {
logService.warn(`[chat setup] No output channel available`);
}

await issueService.openReporter({
extensionId: defaultChat.chatExtensionId,
issueTitle: 'Chat took too long to get ready',
issueBody: 'Chat took too long to get ready',
data: outputData || localize('chatOutputChannelUnavailable', "GitHub Copilot Chat output channel not available. Please ensure the GitHub Copilot Chat extension is active and try again. If the issue persists, you can manually include relevant information from the Output panel (View > Output > GitHub Copilot Chat).")
});
}));
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

According to the PR description, this command should be implemented as a ReportChatIssueWithOutputAction using Action2 in chatSetupContributions.ts, not as a CommandsRegistry command in chatSetupProviders.ts. The current implementation:

  1. Does not follow the pattern established by other chat actions which use Action2
  2. Is not registered with f1:true to appear in the command palette
  3. Is not properly gated on ChatContextKeys.enabled as required by coding guideline 1000002
  4. Has the command ID as a private static constant, preventing reuse elsewhere

The command should be refactored into an Action2 class in chatSetupContributions.ts with proper preconditions (ChatContextKeys.enabled, ChatContextKeys.Setup.installed) and f1 registration.

This issue also appears in the following locations of the same file:

  • line 190
  • line 195

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +230 to +234
await issueService.openReporter({
extensionId: defaultChat.chatExtensionId,
issueTitle: 'Chat took too long to get ready',
issueBody: 'Chat took too long to get ready',
data: outputData || localize('chatOutputChannelUnavailable', "GitHub Copilot Chat output channel not available. Please ensure the GitHub Copilot Chat extension is active and try again. If the issue persists, you can manually include relevant information from the Output panel (View > Output > GitHub Copilot Chat).")
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The PR description states that this command should accept optional issueTitle and issueBody parameters and pass them through to the issue reporter. However, the implementation has hardcoded values:

  • issueTitle: 'Chat took too long to get ready'
  • issueBody: 'Chat took too long to get ready'

The command handler should accept an optional parameter object with issueTitle and issueBody fields, and use these values if provided, falling back to defaults if not. This would match the documented usage in the PR description.

This issue also appears in the following locations of the same file:

  • line 370

Copilot uses AI. Check for mistakes.
Comment on lines 56 to 61
const defaultChat = {
extensionId: product.defaultChatAgent?.extensionId ?? '',
chatExtensionId: product.defaultChatAgent?.chatExtensionId ?? '',
provider: product.defaultChatAgent?.provider ?? { default: { id: '', name: '' }, enterprise: { id: '', name: '' }, apple: { id: '', name: '' }, google: { id: '', name: '' } },
outputChannelId: product.defaultChatAgent?.chatExtensionOutputId ?? '',
};
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

This constant is duplicated in chatSetupProviders.ts (line 60). According to coding guideline 1000000, "Do not duplicate code. Always look for existing utility functions, helpers, or patterns in the codebase before implementing new functionality." The defaultChat constant should be defined in one location and imported where needed, or the outputChannelId should be accessed directly from product.defaultChatAgent?.chatExtensionOutputId.

Copilot generated this review using guidance from repository custom instructions.
} else {
logService.warn(`[chat setup] Output channel '${defaultChat.outputChannelId}' not found, falling back to Window output channel`);
channel = outputService.getChannel('rendererLog');
channelName = 'Window';
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

According to the coding guideline 1000000, "Use 'single quotes' for strings that don't need to be externalized". The string 'Window' is used as a channel name label in the output and should either be externalized with localize() for proper localization, or should use the windowLogGroup.name constant from 'src/vs/workbench/services/log/common/logConstants.ts' which is already localized.

This issue also appears in the following locations of the same file:

  • line 209

Copilot generated this review using guidance from repository custom instructions.

let channel = outputService.getChannel(defaultChat.outputChannelId);
if (channel) {
channelName = defaultChat.outputChannelId;
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The variable channelName is being set to the full output channel ID (e.g., "GitHub.copilot-chat.GitHub Copilot Chat.log") which will appear in the formatted output as "GitHub Copilot Chat Output (GitHub.copilot-chat.GitHub Copilot Chat.log)". This is overly verbose and exposes internal implementation details. Consider extracting just the display name portion or using a more user-friendly label like "GitHub Copilot Chat" for the primary channel case.

Suggested change
channelName = defaultChat.outputChannelId;
channelName = channel.label;

Copilot uses AI. Check for mistakes.
model.dispose();
}
} catch (error) {
logService.error(`[chat setup] Failed to retrieve output channel content: ${error}`);
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The error is logged but the error object is coerced to a string via template literal interpolation, which may not provide useful details for debugging. Use toErrorMessage(error) helper (already imported at line 10) to get a more detailed error message, or log the error object directly as a second parameter to logService.error for better diagnostics.

Suggested change
logService.error(`[chat setup] Failed to retrieve output channel content: ${error}`);
logService.error('[chat setup] Failed to retrieve output channel content', error);

Copilot uses AI. Check for mistakes.
Comment thread product.json
"defaultChatAgent": {
"extensionId": "GitHub.copilot",
"chatExtensionId": "GitHub.copilot-chat",
"chatExtensionOutputId": "GitHub.copilot-chat.GitHub Copilot Chat.log",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The chatExtensionOutputId format appears to combine the extension ID with a channel name and suffix ("GitHub.copilot-chat.GitHub Copilot Chat.log"). This format is unusual and may not match how VS Code extensions typically register output channels. Verify that this ID format is correct and matches how the GitHub Copilot Chat extension actually registers its output channel. If the extension uses a different ID format, this value will prevent the feature from working correctly.

Suggested change
"chatExtensionOutputId": "GitHub.copilot-chat.GitHub Copilot Chat.log",
"chatExtensionOutputId": "GitHub.copilot-chat#GitHub Copilot Chat.log",

Copilot uses AI. Check for mistakes.
eli-w-king pushed a commit that referenced this pull request Jan 14, 2026
…t-issue-reporter

Add action to report GitHub Copilot Chat issues with output channel contents
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants