agentHostSessionTitleController.ts ×8

Frontier kind: Code frontier

unlabeled · c_2ca6a67d184b

47 tests · 20100 LOC · 86 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2020 ranges20100 lines · 86 files · Browse complete extent
All tests (intent)
47 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: 34 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostSessionTitleController.ts 34 introduced LOC · 8 ranges

Open complete file

304
305 private _generateTitleSoon(
306 > key: ProtocolURI, agentHostSessionTitleController.ts
307 > promptContent: string,
308 > isConversation: boolean,
309 > fallbackTitle: string,
310 > apply: (title: string) => void,
311 > currentTitleMatchesFallback: () => boolean,
312 > persist: (title: string) => void,
313 > ): void {
314 > this._cancelTitleGeneration(key);
315 > const source = new CancellationTokenSource();
316 > this._titleGenerationCancellationSources.set(key, source);
317 > void this._generateTitle(key, promptContent, isConversation, fallbackTitle, apply, currentTitleMatchesFallback, persist, source.token).catch(err => {
318 if (!source.token.isCancellationRequested) {
319 this._logService.warn(`[AgentHostSessionTitleController] Failed to apply generated title for ${key}`, err);
320 }
321 > }).finally(() => { agentHostSessionTitleController.ts
322 > if (this._titleGenerationCancellationSources.get(key) === source) {
323 this._titleGenerationCancellationSources.delete(key);
324 source.dispose();
325 }
327 > }
328
329 private async _generateTitle(
330 > key: ProtocolURI, agentHostSessionTitleController.ts
331 > promptContent: string,
332 > isConversation: boolean,
333 > fallbackTitle: string,
334 > apply: (title: string) => void,
335 > currentTitleMatchesFallback: () => boolean,
336 > persist: (title: string) => void,
337 > token: CancellationToken,
338 > ): Promise<void> {
339 > const generatedTitle = await this._generateTitleFromPrompt(promptContent, isConversation, token);
340 > if (token.isCancellationRequested || !generatedTitle) {
341 return;
342 }
350 }
351 persist(generatedTitle);
353
354 private async _generateTitleFromPrompt(promptContent: string, isConversation: boolean, token: CancellationToken): Promise<string | undefined> {
355 > if (token.isCancellationRequested) { agentHostSessionTitleController.ts
356 return undefined;
357 }
359 > const githubToken = this._options.getGitHubCopilotToken?.();
360 > const copilotApiService = this._options.copilotApiService;
361 > if (!githubToken || !copilotApiService) {
362 return undefined;
363 }
381 cancellationListener.dispose();
382 }
384
385 private _buildTitlePrompt(promptContent: string, isConversation: boolean): ICopilotUtilityChatMessage[] {