Summary
The copilot-sdk package does not expose respondToExitPlanMode, even though the full SDK (sdk/index.d.ts) has it. VS receives ExitPlanModeRequestedEvent with the available actions but has no way to respond. The CLI auto-proceeds with the recommended action, bypassing the user's choice.
Evidence
Full SDK (@github/copilot/sdk/index.d.ts) — HAS it:
// Line 13896 — method on session class
respondToExitPlanMode(requestId: string, response: ExitPlanModeResponse): void;
// Line 17077 — hook on session base
protected onExitPlanMode?: (request: ExitPlanModeRequest) => Promise<ExitPlanModeResponse>;
// Line 10224 — response type
type ExitPlanModeResponse = {
approved: boolean;
selectedAction?: ExitPlanModeAction; // "exit_only" | "interactive" | "autopilot" | "autopilot_fleet"
autoApproveEdits?: boolean;
feedback?: string;
};
Thin wrapper (copilot-sdk/session.d.ts) — MISSING:
session-events.d.ts line 2943 references it in a comment: "used to respond via session.respondToExitPlanMode()" — but the method does not exist on the CopilotSession class
- session.d.ts exposes
registerPermissionHandler and registerUserInputHandler — no registerExitPlanModeHandler
- extension.js handles
permission.requested and tool.call broadcasts — no handler for exit_plan_mode.requested
- types.d.ts
SessionConfig has onPermissionRequest and onUserInputRequest — no onExitPlanMode
What VS sees:
ExitPlanModeRequestedEvent fires correctly with RequestId, Summary, Actions[], RecommendedAction ✅
- No way to call
respondToExitPlanMode(requestId, response) ❌
- CLI auto-proceeds after timeout, ignoring the user
What we need
Either of:
- A method on
CopilotSession:
respondToExitPlanMode(requestId: string, response: ExitPlanModeResponse): void;
- A callback on
SessionConfig:
onExitPlanMode?: (request: ExitPlanModeRequest) => Promise<ExitPlanModeResponse>;
Both patterns already exist for permissions (onPermissionRequest / registerPermissionHandler) and user input (onUserInputRequest / registerUserInputHandler). This would follow the same pattern.
Impact
This blocks VS from offering plan approval with mode selection.
Thank you
Summary
The
copilot-sdkpackage does not exposerespondToExitPlanMode, even though the full SDK (sdk/index.d.ts) has it. VS receivesExitPlanModeRequestedEventwith the available actions but has no way to respond. The CLI auto-proceeds with the recommended action, bypassing the user's choice.Evidence
Full SDK (
@github/copilot/sdk/index.d.ts) — HAS it:Thin wrapper (
copilot-sdk/session.d.ts) — MISSING:session-events.d.tsline 2943 references it in a comment: "used to respond via session.respondToExitPlanMode()" — but the method does not exist on theCopilotSessionclassregisterPermissionHandlerandregisterUserInputHandler— noregisterExitPlanModeHandlerpermission.requestedandtool.callbroadcasts — no handler forexit_plan_mode.requestedSessionConfighasonPermissionRequestandonUserInputRequest— noonExitPlanModeWhat VS sees:
ExitPlanModeRequestedEventfires correctly withRequestId,Summary,Actions[],RecommendedAction✅respondToExitPlanMode(requestId, response)❌What we need
Either of:
CopilotSession:SessionConfig:Both patterns already exist for permissions (
onPermissionRequest/registerPermissionHandler) and user input (onUserInputRequest/registerUserInputHandler). This would follow the same pattern.Impact
This blocks VS from offering plan approval with mode selection.
Thank you