Fix for removing warning text on CCA pending changes (#1502)

This commit is contained in:
Osvaldo Ortega
2025-10-22 22:47:43 +00:00
committed by GitHub
parent 45fb4f1b25
commit fb8bd59611
@@ -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<RemoteAgentResult> {
async invokeRemoteAgent(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise<RemoteAgentResult | undefined> {
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<RemoteAgentResult> {
private async invokeRemoteAgentWithoutChangesCheck(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string): Promise<RemoteAgentResult | undefined> {
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<RemoteAgentResult> {
private async invokeRemoteAgentInternal(prompt: string, problemContext?: string, token?: vscode.CancellationToken, autoPushAndCommit = true, chatStream?: vscode.ChatResponseStream, customAgentName?: string, checkForChanges = true): Promise<RemoteAgentResult | undefined> {
// 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 {