Skip to content

Commit 11eb426

Browse files
committed
Updates
1 parent 75151dc commit 11eb426

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/extension/chatSessions/copilotcli/node/copilotcliSession.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -456,22 +456,25 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
456456
this._sdkSession.respondToExitPlanMode(event.data.requestId, { approved: false });
457457
return;
458458
}
459-
const actionDescriptions: Record<ActionType, string> = {
460-
'autopilot': l10n.t('Auto-approve all tool calls and continue until the task is done'),
461-
'interactive': l10n.t('Let the agent continue in interactive mode, asking for user input and approval for each action.'),
462-
'exit_only': l10n.t('Exit plan mode, but do not execute the plan. I will execute the plan myself after reviewing it.'),
463-
'autopilot_fleet': l10n.t('Auto-approve all tool calls, including fleet management actions, and continue until the task is done.'),
464-
};
459+
const actionDescriptions: Record<string, { label: string; description: string }> = {
460+
'autopilot': { label: 'Autopilot', description: l10n.t('Auto-approve all tool calls and continue until the task is done') },
461+
'interactive': { label: 'Interactive', description: l10n.t('Let the agent continue in interactive mode, asking for user input and approval for each action.') },
462+
'exit_only': { label: 'Approve and exit plan mode', description: l10n.t('Exit plan mode, but do not execute the plan. I will execute the plan myself after reviewing it.') },
463+
'autopilot_fleet': { label: 'Autopilot Fleet', description: l10n.t('Auto-approve all tool calls, including fleet management actions, and continue until the task is done.') },
464+
} satisfies Record<ActionType, { label: string; description: string }>;
465465

466466
const approved = true;
467-
event.data.actions;
468467
try {
469468
const planPath = this._sdkSession.getPlanPath();
470469

471470
const userInputRequest: IQuestion = {
472-
question: planPath ? l10n.t('Approve this plan {0}?', Uri.file(planPath).toString()) : l10n.t('Approve this plan?'),
471+
question: planPath ? l10n.t('Approve this plan {0}?', `[Plan.md](${Uri.file(planPath).toString()})`) : l10n.t('Approve this plan?'),
473472
header: l10n.t('Approve this plan?'),
474-
options: event.data.actions.map(a => ({ label: (actionDescriptions as Record<string, string>)[a] ?? a, recommended: a === event.data.recommendedAction })),
473+
options: event.data.actions.map(a => ({
474+
label: actionDescriptions[a]?.label ?? a,
475+
recommended: a === event.data.recommendedAction,
476+
description: actionDescriptions[a]?.description ?? '',
477+
})),
475478
allowFreeformInput: true,
476479
};
477480
const answer = await this._userQuestionHandler.askUserQuestion(userInputRequest, this._toolInvocationToken as unknown as never, token);
@@ -484,8 +487,8 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
484487
this._sdkSession.respondToExitPlanMode(event.data.requestId, { approved: false, feedback: answer.freeText });
485488
} else {
486489
let selectedAction: ActionType = answer.selected[0] as ActionType;
487-
Object.entries(actionDescriptions).forEach(([action, description]) => {
488-
if (description === selectedAction) {
490+
Object.entries(actionDescriptions).forEach(([action, item]) => {
491+
if (item.label === selectedAction) {
489492
selectedAction = action as ActionType;
490493
}
491494
});

0 commit comments

Comments
 (0)