mapSessionEvents.ts ×20

Frontier kind: Code frontier

unlabeled · c_e32624a5d5f2

38 tests · 32746 LOC · 175 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
20 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2759 ranges32746 lines · 175 files · Browse complete extent
All tests (intent)
38 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: 24 introduced LOC across 20 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/mapSessionEvents.ts 24 introduced LOC · 20 ranges

Open complete file

266 const parentToolCallIdByAgentId = new Map<string, string>();
267 const resolveParentToolCallId = (agentId: string | undefined, deprecatedParentToolCallId: string | undefined): string | undefined => {
268 > const mapped = agentId ? parentToolCallIdByAgentId.get(agentId) : undefined; mapSessionEvents.ts
269 > return mapped ?? deprecatedParentToolCallId;
270 > };
271
272 for (const e of events) {
273 > if (e.type === 'subagent.started') { mapSessionEvents.ts
274 if (e.agentId) {
275 parentToolCallIdByAgentId.set(e.agentId, e.data.toolCallId);
276 }
277 }
278 > if (e.type === 'tool.execution_complete') { mapSessionEvents.ts
279 completionsByCallId.set(e.data.toolCallId, e.data);
280 }
281 > if (e.type === 'tool.execution_start') { mapSessionEvents.ts
282 const d = e.data;
283 const parentToolCallId = resolveParentToolCallId(e.agentId, d.parentToolCallId);
292 }
293 }
295
296 // Pre-load stored file-edit metadata for all edit tool calls.
381
382 for (const e of events) {
383 > switch (e.type) { mapSessionEvents.ts
384 > case 'assistant.turn_start':
385 if (!e.agentId) {
386 rootAssistantTurnActive = true;
387 }
388 break;
389 > case 'assistant.turn_end': mapSessionEvents.ts
390 if (!e.agentId) {
391 rootAssistantTurnActive = false;
392 }
393 break;
394 > case 'session.model_change': { mapSessionEvents.ts
395 currentModel = { id: e.data.newModel };
396 break;
397 }
398 > case 'session.auto_mode_resolved': { mapSessionEvents.ts
399 if (!e.agentId) {
400 pendingAutoModeResolved = e.data;
402 break;
403 }
404 > case 'subagent.deselected': { mapSessionEvents.ts
405 if (!e.agentId) {
406 currentAgent = undefined;
408 break;
409 }
410 > case 'user.message': { mapSessionEvents.ts
411 if (isSyntheticUserMessage(e)) {
412 continue;
448 break;
449 }
450 > case 'assistant.message': { mapSessionEvents.ts
451 const d = e.data;
452 const messageId = d.messageId ?? d.interactionId ?? '';
491 break;
492 }
493 > case 'system.notification': { mapSessionEvents.ts
494 const notification = buildCopilotSystemNotification(e);
495 if (!notification) {
507 break;
508 }
509 > case 'subagent.started': { mapSessionEvents.ts
510 const d = e.data;
511 subagentInfoByToolCallId.set(d.toolCallId, {
516 break;
517 }
518 > case 'tool.execution_start': { mapSessionEvents.ts
519 const parentToolCallId = resolveParentToolCallId(e.agentId, e.data.parentToolCallId);
520 if (!parentToolCallId && parentBuilder) {
523 break;
524 }
525 > case 'tool.execution_complete': { mapSessionEvents.ts
526 const d = e.data;
527 const info = toolInfoByCallId.get(d.toolCallId);
564 break;
565 }
566 > case 'skill.invoked': { mapSessionEvents.ts
567 const synth = synthesizeSkillToolCall(e.data, e.id);
568 const parentToolCallId = resolveParentToolCallId(e.agentId, undefined);
587 break;
588 }
589 > case 'abort': { mapSessionEvents.ts
590 const parentToolCallId = resolveParentToolCallId(e.agentId, undefined);
591 if (parentToolCallId) {