refactor(copilotcli): update action descriptions and adjust plan path handling#308954
Merged
DonJayamanne merged 1 commit intomainfrom Apr 10, 2026
Merged
refactor(copilotcli): update action descriptions and adjust plan path handling#308954DonJayamanne merged 1 commit intomainfrom
DonJayamanne merged 1 commit intomainfrom
Conversation
Contributor
Contributor
There was a problem hiding this comment.
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
/planand/fleetcommands inextensions/copilot/package.jsonby setting theirwhentofalse.
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 unconditionalrespondToExitPlanMode(..., { 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.,returnimmediately after responding, or move the fallback deny into thecatch/a guardedfinally).
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
68b0d88 to
39fe09e
Compare
chrmarti
approved these changes
Apr 10, 2026
lszomoru
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For https://github.com/github/copilot-agent-runtime/issues/5660