Skip to content

refactor(copilotcli): update action descriptions and adjust plan path handling#308954

Merged
DonJayamanne merged 1 commit intomainfrom
don/wide-wildebeest
Apr 10, 2026
Merged

refactor(copilotcli): update action descriptions and adjust plan path handling#308954
DonJayamanne merged 1 commit intomainfrom
don/wide-wildebeest

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings April 10, 2026 06:17
@DonJayamanne DonJayamanne self-assigned this Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 05d42a27 Current: 9ba77e58

Changed (2)

agentSessionsViewer/WithMarkdownBadge/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Copilot CLI chat session’s “exit plan mode” approval UX by introducing labeled options with descriptions and optionally surfacing a link to the generated plan, while also adjusting command contribution visibility for /plan and /fleet.

Changes:

  • Add getPlanPath() to the Copilot SDK session mock to match session expectations.
  • Update exit-plan-mode approval prompt to show option labels + descriptions and include a plan link when available.
  • Disable the contributed /plan and /fleet commands in extensions/copilot/package.json by setting their when to false.
Show a summary per file
File Description
extensions/copilot/src/extension/chatSessions/copilotcli/node/test/copilotcliSession.spec.ts Updates mock session shape to include getPlanPath() so tests compile with newer session usage.
extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts Refines exit-plan-mode approval prompt (labels/descriptions, optional plan link) and uses getPlanPath().
extensions/copilot/package.json Makes /plan and /fleet command contributions permanently hidden via when: "false".

Copilot's findings

Comments suppressed due to low confidence (1)

extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts:519

  • respondToExitPlanMode(...) can be invoked inside the try block (approved/denied), but then a second unconditional respondToExitPlanMode(..., { approved: false }) is sent afterwards. This risks double-responding to the same request (and depending on SDK behavior could override/ignore the intended decision). Ensure the request is responded to exactly once (e.g., return immediately after responding, or move the fallback deny into the catch/a guarded finally).
						if (answer.freeText) {
							this._sdkSession.respondToExitPlanMode(event.data.requestId, { approved: false, feedback: answer.freeText });
						} else {
							let selectedAction: ActionType = answer.selected[0] as ActionType;
							Object.entries(actionDescriptions).forEach(([action, item]) => {
								if (item.label === selectedAction) {
									selectedAction = action as ActionType;
								}
							});
							const autoApproveEdits = approved && this._permissionLevel === 'autoApprove' ? true : undefined;
							this._sdkSession.respondToExitPlanMode(event.data.requestId, { approved: true, selectedAction, autoApproveEdits });
						}
					} catch (error) {
						this.logService.error(error, '[ConfirmationTool] Error showing confirmation tool for exit plan mode');
					}
					this._sdkSession.respondToExitPlanMode(event.data.requestId, { approved: false });

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread extensions/copilot/package.json
@DonJayamanne DonJayamanne marked this pull request as ready for review April 10, 2026 06:48
@DonJayamanne DonJayamanne enabled auto-merge (squash) April 10, 2026 06:49
@DonJayamanne DonJayamanne merged commit e9aba23 into main Apr 10, 2026
26 checks passed
@DonJayamanne DonJayamanne deleted the don/wide-wildebeest branch April 10, 2026 06:58
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants