diff --git a/src/github/copilotRemoteAgent.ts b/src/github/copilotRemoteAgent.ts index e31b3b0c6b..6d46b17e69 100644 --- a/src/github/copilotRemoteAgent.ts +++ b/src/github/copilotRemoteAgent.ts @@ -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'; @@ -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) { @@ -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; }