askQuestionsTool.ts ×11

Frontier kind: Joint frontier

unlabeled · c_65be5b512940

1 test · 27589 LOC · 140 files · introduces 1 test · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges41 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2882 ranges27589 lines · 140 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.ts 41 introduced LOC · 11 ranges

Open complete file

222 this.chatService.appendProgress(request, carousel);
223 const externalAnswerListener = this.chatService.onDidReceiveQuestionCarouselAnswer(event => {
224 > if (event.resolveId !== carousel.resolveId || carousel.isUsed) { askQuestionsTool.ts
225 return;
226 }
227 > carousel.dismiss(event.answers); askQuestionsTool.ts
228 });
229
243 throw new CancellationError();
244 }
245 > if (token.isCancellationRequested) { askQuestionsTool.ts
246 throw new CancellationError();
247 }
249 > // When the user typed directly in the terminal (bypassing the carousel),
250 > // tell the agent to stop asking questions and wait for the command to finish.
251 if (carousel.dismissedByTerminalInput && carousel.terminalId) {
252 this.logService.info(`[AskQuestionsTool] Carousel dismissed because user typed directly in terminal ${carousel.terminalId}`);
258 };
259 }
261 > progress.report({ message: localize('askQuestionsTool.progress', 'Analyzing your answers...') });
262 >
263 const converted = this.convertCarouselAnswers(questions, answerResult?.answers, idToHeaderMap);
264 const { answeredCount, skippedCount, freeTextCount, recommendedAvailableCount, recommendedSelectedCount } = this.collectMetrics(questions, converted);
392 } else if (question.multiSelect) {
393 type = 'multiSelect';
394 > } else { askQuestionsTool.ts
395 > type = 'singleSelect';
396 > }
397
398 let defaultValue: string | string[] | undefined;
399 if (question.options) {
400 > const recommendedOptions = question.options.filter(opt => opt.recommended); askQuestionsTool.ts
401 > if (recommendedOptions.length > 0) {
402 defaultValue = question.multiSelect ? recommendedOptions.map(opt => opt.label) : recommendedOptions[0].label;
403 }
405
406 // Use a stable UUID as the internal ID to avoid collisions when truncating headers
419 detailedMessage: question.message,
420 options: question.options?.map(opt => ({
421 > id: opt.label, askQuestionsTool.ts
422 > label: opt.description ? `${opt.label} - ${opt.description}` : opt.label,
423 > value: opt.label
424 })),
425 defaultValue,
533
534 private collectMetrics(questions: IQuestion[], result: IAnswerResult): { answeredCount: number; skippedCount: number; freeTextCount: number; recommendedAvailableCount: number; recommendedSelectedCount: number } {
535 > const answers = Object.values(result.answers); askQuestionsTool.ts
536 > const answeredCount = answers.filter(a => !a.skipped).length;
537 > const skippedCount = answers.filter(a => a.skipped).length;
538 > const freeTextCount = answers.filter(a => a.freeText !== null).length;
539 > const recommendedAvailableCount = questions.filter(q => q.options?.some(opt => opt.recommended)).length;
540 > const recommendedSelectedCount = questions.filter(q => {
541 > const answer = result.answers[q.header];
542 > const recommendedOption = q.options?.find(opt => opt.recommended);
543 > return answer && !answer.skipped && recommendedOption && answer.selected.includes(recommendedOption.label);
544 > }).length;
545 > return { answeredCount, skippedCount, freeTextCount, recommendedAvailableCount, recommendedSelectedCount };
546 > }
547
548 private createSkippedResult(questions: IQuestion[]): IToolResult {
611
612 private sendTelemetry(requestId: string | undefined, questionCount: number, answeredCount: number, skippedCount: number, freeTextCount: number, recommendedAvailableCount: number, recommendedSelectedCount: number, duration: number): void {
613 > this.telemetryService.publicLog2<AskQuestionsToolInvokedEvent, AskQuestionsToolInvokedClassification>('askQuestionsToolInvoked', { askQuestionsTool.ts
614 > requestId,
615 > questionCount,
616 > answeredCount,
617 > skippedCount,
618 > freeTextCount,
619 > recommendedAvailableCount,
620 > recommendedSelectedCount,
621 > duration,
622 > });
623 > }
624 }
625