copilotAgentSession.ts ×5

Frontier kind: Code frontier

unlabeled · c_cc548d974884

14 tests · 43729 LOC · 243 files · introduces 0 tests · 49 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges49 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3989 ranges43729 lines · 243 files · Browse complete extent
All tests (intent)
14 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 49 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 49 introduced LOC · 5 ranges

Open complete file

4077 */
4078 private async _handleExitPlanModeRequest(data: ExitPlanModeRequest, _invocation: { sessionId: string }): Promise<IExitPlanModeResponse> {
4079 > const turnId = this._currentTurn?.id; copilotAgentSession.ts
4080 > if (!turnId) {
4081 this._logService.warn(`[Copilot:${this.sessionId}] Rejecting plan review request without an active turn`);
4082 return { approved: false };
4083 }
4084 > const requestId = generateUuid(); copilotAgentSession.ts
4085 > const questionId = generateUuid();
4086 > this._logService.info(`[Copilot:${this.sessionId}] exitPlanMode.request: rpcId=${requestId}, actions=[${data.actions.join(',')}], recommended=${data.recommendedAction}`);
4087 >
4088 > let planPath: string | null = null;
4089 > try {
4090 > const planRead = await this._wrapper.session.rpc.plan.read();
4091 > planPath = planRead.path ?? null;
4092 > } catch (err) {
4093 this._logService.warn(`[Copilot:${this.sessionId}] rpc.plan.read failed for exit_plan_mode: ${err instanceof Error ? err.message : String(err)}`);
4094 }
4095 > if (this._currentTurn?.id !== turnId) { copilotAgentSession.ts
4096 this._logService.warn(`[Copilot:${this.sessionId}] Rejecting plan review request after its turn ended`);
4097 return { approved: false };
4120 title: localize('agentHost.planReview.title', "Review Plan"),
4121 content: data.summary || localize('agentHost.planReview.fallbackSummary', "A plan is ready for review."),
4122 > actions, copilotAgentSession.ts
4123 > canProvideFeedback: true,
4124 > answerQuestionId: questionId,
4125 > ...(planPath ? { planUri: URI.file(planPath).toString() } : {}),
4126 > },
4127 > questions: [{
4128 > kind: ChatInputQuestionKind.SingleSelect,
4129 > id: questionId,
4130 > title: localize('agentHost.planReview.title', "Review Plan"),
4131 > message: localize('agentHost.planReview.questionMessage', "How would you like to proceed?"),
4132 > required: true,
4133 > options,
4134 > allowFreeformInput: true,
4135 > }],
4136 > };
4137 >
4138 > const deferred = new DeferredPromise<IExitPlanModeResponse>();
4139 > this._pendingPlanReviews.set(requestId, {
4140 > actions: data.actions,
4141 > recommendedAction: data.recommendedAction,
4142 > questionId,
4143 > deferred,
4144 > });
4145 >
4146 > this._onDidSessionProgress.fire({
4147 > kind: 'action',
4148 > resource: this._chatChannelUri,
4149 > action: {
4150 > type: ActionType.ChatInputRequested,
4151 > request: inputRequest,
4152 > }
4153 > });
4154 >
4155 > try {
4156 > return await deferred.p;
4157 > } catch (err) {
4158 this._logService.error(err, `[Copilot:${this.sessionId}] exitPlanMode.request handler failed: rpcId=${requestId}`);
4159 return { approved: false };
4160 }
4162
4163 /**