copilotSessionLauncher.ts ×3

Frontier kind: Code frontier

unlabeled · c_591f23542eb2

4 tests · 30578 LOC · 151 files · introduces 0 tests · 35 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges35 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2620 ranges30578 lines · 151 files · Browse complete extent
All tests (intent)
4 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: 35 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts 35 introduced LOC · 3 ranges

Open complete file

316 return {};
317 }
318 > // Deduplicate by selection id (`vendor/id`). The same BYOK model can be copilotSessionLauncher.ts
319 > // reported more than once — e.g. when two renderer bridges are transiently
320 > // serving during a window hand-off (continuing a chat into a new session) —
321 > // and the runtime rejects a session config with duplicate BYOK model
322 > // selection ids ("Duplicate BYOK model selection id ...").
323 > const seenSelectionIds = new Set<string>();
324 > byokModels = byokModels.filter(m => {
325 > const selectionId = `${m.vendor}/${m.id}`;
326 > if (seenSelectionIds.has(selectionId)) {
327 return false;
328 }
329 > seenSelectionIds.add(selectionId); copilotSessionLauncher.ts
330 > return true;
331 > });
332 > // `startProxy` binds a local loopback listener — unlikely to fail, but it
333 > // must never break session materialization (which fires the cross-window
334 > // `sessionAdded` broadcast). Degrade to no BYOK config on failure.
335 > let handle: IByokLmProxyHandle;
336 > try {
337 > handle = await startProxy();
338 > } catch (err) {
339 logService.warn(`[Copilot:${sessionId}] Failed to start BYOK loopback proxy`, err);
340 return {};
341 }
342 > const providers: NamedProviderConfig[] = [...new Set(byokModels.map(m => m.vendor))].map(vendor => ({ copilotSessionLauncher.ts
343 > name: vendor,
344 > type: 'openai',
345 > wireApi: 'completions',
346 > baseUrl: handle.providerBaseUrl(vendor),
347 > bearerToken: `${handle.nonce}.${sessionId}`,
348 > }));
349 > const models: ProviderModelConfig[] = byokModels.map(m => ({
350 > id: m.id,
351 > provider: m.vendor,
352 > ...(m.name !== undefined ? { name: m.name } : {}),
353 > ...(m.maxContextWindowTokens !== undefined ? { maxContextWindowTokens: m.maxContextWindowTokens } : {}),
354 > }));
355 > logService.info(`[Copilot:${sessionId}] Wired ${models.length} BYOK model(s) across ${providers.length} provider(s) via loopback proxy ${handle.baseUrl}`);
356 > return { providers, models };
357 > }
358
359 export class CopilotSessionLauncher implements ICopilotSessionLauncher {