From fb8bd59611a0b63ce88df5ffa7ced3fcf8c768cf Mon Sep 17 00:00:00 2001 From: Osvaldo Ortega <48293249+osortega@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:47:43 -0700 Subject: [PATCH] Fix for removing warning text on CCA pending changes (#1502) --- .../vscode-node/copilotCloudSessionsProvider.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts b/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts index 1732307b4e1..67de39d2dcd 100644 --- a/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts +++ b/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts @@ -408,6 +408,9 @@ export class CopilotChatSessionsProvider extends Disposable implements vscode.Ch stream, customAgentName, ); + if (!result) { + return; + } if (result.state !== 'success') { this.logService.error(`Failed to provide new chat session item: ${result.error}${result.innerError ? `\nInner Error: ${result.innerError}` : ''}`); stream.warning(result.error); @@ -440,7 +443,7 @@ export class CopilotChatSessionsProvider extends Disposable implements vscode.Ch const { prompt, problemContext, customAgentName } = data.metadata as UncommittedChangesMetadata; // Continue with the agent invocation, skipping the uncommitted changes const result = await this.invokeRemoteAgentWithoutChangesCheck(prompt, problemContext, undefined, true, stream, customAgentName); - if (result.state !== 'success') { + if (result && result.state !== 'success') { stream.warning(result.error); return {}; } @@ -924,15 +927,15 @@ export class CopilotChatSessionsProvider extends Disposable implements vscode.Ch return undefined; } - async invokeRemoteAgent(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise { + async invokeRemoteAgent(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise { return this.invokeRemoteAgentInternal(prompt, problemContext, token, autoPushAndCommit, chatStream, customAgentName, true); } - private async invokeRemoteAgentWithoutChangesCheck(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise { + private async invokeRemoteAgentWithoutChangesCheck(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise { return this.invokeRemoteAgentInternal(prompt, problemContext, token, autoPushAndCommit, chatStream, customAgentName, false); } - private async invokeRemoteAgentInternal(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string, checkForChanges = true): Promise { + private async invokeRemoteAgentInternal(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string, checkForChanges = true): Promise { // TODO: support selecting remote // await this.promptAndUpdatePreferredGitHubRemote(true); const repoId = await getRepoId(this._gitService); @@ -983,7 +986,7 @@ export class CopilotChatSessionsProvider extends Disposable implements vscode.Ch }, ['Proceed', 'Cancel'] ); - return { error: vscode.l10n.t('Awaiting user confirmation'), state: 'error' }; + return; } else { // Fallback for cases where chatStream is not available return {