Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/github/copilotRemoteAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const CONTINUE_AND_DO_NOT_ASK_AGAIN = vscode.l10n.t('Continue and don\'t ask aga

const CONTINUE_TRUNCATION = vscode.l10n.t('Continue with truncation');
const DELEGATE_MODAL_DETAILS = vscode.l10n.t('The agent will work asynchronously to create a pull request with your requested changes.');
const DISABLE_CODELENS = vscode.l10n.t('Disable Code Lens');

const COPILOT = '@copilot';

Expand Down Expand Up @@ -605,16 +606,19 @@ export class CopilotRemoteAgentManager extends Disposable {
const message = vscode.l10n.t('Copilot coding agent will continue your work in \'{0}\'.', repoName);
const detail = DELEGATE_MODAL_DETAILS;
if (source !== 'prompt' && hasChanges && CopilotRemoteAgentConfig.getAutoCommitAndPushEnabled()) {
// Pending changes modal

const buttons = [PUSH_CHANGES, CONTINUE_WITHOUT_PUSHING, LEARN_MORE];
if (source === 'todo') {
buttons.push(DISABLE_CODELENS);
}

const modalResult = await vscode.window.showInformationMessage(
message,
{
modal: true,
detail,
},
PUSH_CHANGES,
CONTINUE_WITHOUT_PUSHING,
LEARN_MORE,
...buttons,
);

if (!modalResult) {
Expand All @@ -632,6 +636,11 @@ export class CopilotRemoteAgentManager extends Disposable {
return;
}

if (modalResult === DISABLE_CODELENS) {
vscode.commands.executeCommand('workbench.action.openSettings', 'githubPullRequests.codingAgent.codeLens');
return;
}

if (modalResult === PUSH_CHANGES) {
autoPushAndCommit = true;
}
Expand Down
Loading