src/vs/platform/agentHost/test/node/copilotTestEvents.ts

149 LOC · 149 covered · 0 uncovered · 2 ranges · 53 concepts · 2 introducers · 43 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filehistoryRecordFixtures.ts ×1 · 1 introduced LOChistoryRecordFixtures.ts…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps task_complete to a root markdown response part|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×3 · 19 introduced LOCmapSessionEvents.ts ×3historyRecordFixtures.ts ×1 · 1 introduced LOChistoryRecordFixtures.ts…historyRecordFixtures.ts ×5 · 35 introduced LOChistoryRecordFixtures.ts…mapSessionEvents.ts ×1 · 6 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.test|title=mapSessionEvents — subagent routing subagent abort marks the subagent turn cancelled|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.ts ×1 · 1 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.ts ×1 · 2 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.ts ×6 · 15 introduced LOCmapSessionEvents.ts ×6historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration non-edit tools do not get file edits even if db has data|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles quoted directory in cd prefix|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×4 · 8 introduced LOCmapSessionEvents.ts ×4historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles trailing slash on workingDirectory|occurrence=1, historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting strips redundant bash cd prefix matching workingDirectory|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when cd dir does not match|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting rewrites powershell commands too|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.test|title=mapSessionEvents — history replay maps SDK shell_exit content to terminal completion on replayed tool completion|occurrence=1, mapSessionEvents.test|title=mapSessionEvents — history replay preserves non-zero terminal completion even when SDK tool completion succeeded|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay uses top-level user messages as turn boundaries|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.ts ×1 · 2 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.test|title=mapSessionEvents — history replay a regular tool still renders as a tool call|occurrence=1, mapSessionEvents.test|title=mapSessionEvents — history replay tool-only turn without a terminal assistant message remains cancelled|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay derives shell tool intention from the description argument on replay|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay terminal empty assistant message completes a tool-only turn|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration works without database (no file edits restored)|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps tool start and complete events|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×1 · 5 introduced LOCmapSessionEvents.ts ×1historyRecordFixtures.ts ×1 · 2 introduced LOChistoryRecordFixtures.ts…copilotToolDisplay.ts ×2 · 4 introduced LOCcopilotToolDisplay.ts ×2mapSessionEvents.test|title=mapSessionEvents — history replay task_complete with a summary renders as a markdown part, not a tool call|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1mapSessionEvents.ts ×1 · 13 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.ts ×1 · 6 introduced LOCmapSessionEvents.ts ×1historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when no workingDirectory provided|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting non-shell tools are not rewritten even with matching command field|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×1 · 4 introduced LOCmapSessionEvents.ts ×1copilotToolDisplay.ts ×1 · 4 introduced LOCcopilotToolDisplay.ts ×1mapSessionEvents.ts ×3 · 5 introduced LOCmapSessionEvents.ts ×3historyRecordFixtures.ts ×2 · 9 introduced LOChistoryRecordFixtures.ts…mapSessionEvents.ts ×2 · 10 introduced LOCmapSessionEvents.ts ×2historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords ignores unknown event types|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×1 · 4 introduced LOCmapSessionEvents.ts ×1historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps user and assistant messages|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords skips tool_complete without matching tool_start|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.ts ×1 · 3 introduced LOCmapSessionEvents.ts ×1historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords subagent events maps subagent.started event to subagent_started progress event|occurrence=1 · 0 introduced LOChistoryRecordFixtures.te…mapSessionEvents.test|title=mapSessionEvents — history replay does not restore a passive notification outside an assistant turn|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.ts ×6 · 14 introduced LOCmapSessionEvents.ts ×6mapSessionEvents.test|title=mapSessionEvents — history replay abort remains terminal for the turn|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…mapSessionEvents.ts ×2 · 11 introduced LOCmapSessionEvents.ts ×2mapSessionEvents.ts ×1 · 2 introduced LOCmapSessionEvents.ts ×1mapSessionEvents.ts ×1 · 2 introduced LOCmapSessionEvents.ts ×1copilotTestEvents.ts ×1 · 2 introduced LOCcopilotTestEvents.ts ×1mapSessionEvents.test|title=appendSdkToolResultContent folds shell_exit into an existing terminal block instead of adding a second one|occurrence=1 · 0 introduced LOCmapSessionEvents.test|ti…copilotTestEvents.ts ×1 · 147 introduced LOCcopilotTestEvents.ts ×1historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles quoted directory in cd prefix|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles quoted directory in cd prefix|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles trailing slash on workingDirectory|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting handles trailing slash on workingDirectory|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when cd dir does not match|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when cd dir does not match|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when no workingDirectory provided|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting leaves command unchanged when no workingDirectory provided|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting non-shell tools are not rewritten even with matching command field|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting non-shell tools are not rewritten even with matching command field|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting rewrites powershell commands too|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting rewrites powershell commands too|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting strips redundant bash cd prefix matching workingDirectory|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords cd-prefix rewriting strips redundant bash cd prefix matching workingDirectory|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords drops orphan task_complete without synthesizing a turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords drops orphan task_complete without synthesizing a turn|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration handles multiple file edits for one tool call|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration handles multiple file edits for one tool call|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration non-edit tools do not get file edits even if db has data|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration non-edit tools do not get file edits even if db has data|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration restores file edits from database for edit tools|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration restores file edits from database for edit tools|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration works without database (no file edits restored)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords file edit restoration works without database (no file edits restored)|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords ignores unknown event types|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords ignores unknown event types|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps task_complete to a root markdown response part|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps task_complete to a root markdown response part|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps tool start and complete events|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps tool start and complete events|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps user and assistant messages|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords maps user and assistant messages|occurrence=1historyRecordFixtures.te…complete from skill.invoked and filters synthetic skill-injected user messages|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords skill events synthesizes tool start/complete from skill.invoked and filters synthetic skill-injected user messages|occurrence=1complete from skill.invo…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords skips tool_complete without matching tool_start|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords skips tool_complete without matching tool_start|occurrence=1historyRecordFixtures.te…historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords subagent events maps subagent.started event to subagent_started progress event|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/historyRecordFixtures.test|title=mapSessionEventsToHistoryRecords subagent events maps subagent.started event to subagent_started progress event|occurrence=1historyRecordFixtures.te…mapSessionEvents.test|title=appendSdkToolResultContent folds shell_exit into an existing terminal block instead of adding a second one|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=appendSdkToolResultContent folds shell_exit into an existing terminal block instead of adding a second one|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay a regular tool still renders as a tool call|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay a regular tool still renders as a tool call|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay abort remains terminal for the turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay abort remains terminal for the turn|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay derives shell tool intention from the description argument on replay|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay derives shell tool intention from the description argument on replay|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay does not restore a passive notification outside an assistant turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay does not restore a passive notification outside an assistant turn|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay fallback task_complete marks the turn complete|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay fallback task_complete marks the turn complete|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay maps SDK shell_exit content to terminal completion on replayed tool completion|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay maps SDK shell_exit content to terminal completion on replayed tool completion|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay preserves non-zero terminal completion even when SDK tool completion succeeded|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay preserves non-zero terminal completion even when SDK tool completion succeeded|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay restores Auto model resolution as usage metadata|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores Auto model resolution as usage metadata|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay restores MCP app data for completed tool calls|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores MCP app data for completed tool calls|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay restores a system notification inside an assistant turn as a response part|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores a system notification inside an assistant turn as a response part|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay restores an idle system notification as a system-initiated turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores an idle system notification as a system-initiated turn|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay restores best-effort model, fallback agent, and attachments onto user messages|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores best-effort model, fallback agent, and attachments onto user messages|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay synthetic user messages do not start a new turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay synthetic user messages do not start a new turn|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay task_complete with a summary renders as a markdown part, not a tool call|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay task_complete with a summary renders as a markdown part, not a tool call|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay task_complete without a summary renders nothing|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay task_complete without a summary renders nothing|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay terminal empty assistant message completes a tool-only turn|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay terminal empty assistant message completes a tool-only turn|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay tool-only turn without a terminal assistant message remains cancelled|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay tool-only turn without a terminal assistant message remains cancelled|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — history replay uses top-level user messages as turn boundaries|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay uses top-level user messages as turn boundaries|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — subagent routing drops subagent user messages whose agentId cannot be mapped|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — subagent routing drops subagent user messages whose agentId cannot be mapped|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — subagent routing routes subagent events tagged with envelope agentId into the subagent transcript|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — subagent routing routes subagent events tagged with envelope agentId into the subagent transcript|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — subagent routing routes subagent skill events into the subagent transcript|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — subagent routing routes subagent skill events into the subagent transcript|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — subagent routing subagent abort before its first response remains cancelled|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — subagent routing subagent abort before its first response remains cancelled|occurrence=1mapSessionEvents.test|ti…mapSessionEvents.test|title=mapSessionEvents — subagent routing subagent abort marks the subagent turn cancelled|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — subagent routing subagent abort marks the subagent turn cancelled|occurrence=1mapSessionEvents.test|ti…Focused file · src/vs/platform/agentHost/test/node/copilotTestEvents.ts · 149 LOCnode/copilotTestEvents.t…

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- copilotTestEvents.ts ×1
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import type { Attachment, SessionEvent, SessionEventPayload, ToolExecutionCompleteContent } from '@github/copilot-sdk';
7 >
8 > // =============================================================================
9 > // Minimal session-event shapes for tests
10 > // =============================================================================
11 > // Production (`node/copilot/mapSessionEvents.ts`) consumes the real SDK
12 > // `SessionEvent` union. The SDK members require envelope fields the mapper
13 > // never reads (`parentId`, `timestamp`, `ephemeral`, …) plus stricter `data`
14 > // shapes, which makes hand-written event literals noisy. These ergonomic
15 > // subsets let tests construct only the fields the mapper actually reads; feed
16 > // them to the production mapper via {@link toSessionEvents}.
17 >
18 > export interface ISessionEventToolStart {
19 > type: 'tool.execution_start';
20 > /** Envelope-level sub-agent instance id; resolved to the parent tool call id via `subagent.started`. */
21 > agentId?: string;
22 > data: {
23 > toolCallId: string;
24 > toolName: string;
25 > arguments?: unknown;
26 > mcpServerName?: string;
27 > mcpToolName?: string;
28 > toolDescription?: unknown;
29 > /** @deprecated Use the envelope-level {@link ISessionEventToolStart.agentId} instead. */
30 > parentToolCallId?: string;
31 > };
32 > }
33 >
34 > export interface ISessionEventToolComplete {
35 > type: 'tool.execution_complete';
36 > /** Envelope-level sub-agent instance id. See {@link ISessionEventToolStart.agentId}. */
37 > agentId?: string;
38 > data: {
39 > toolCallId: string;
40 > success: boolean;
41 > result?: {
42 > /** `content` is result text; `contents` are typed SDK result blocks such as `shell_exit`. */
43 > content?: string;
44 > contents?: ToolExecutionCompleteContent[];
45 > };
46 > error?: { message: string; code?: string };
47 > isUserRequested?: boolean;
48 > toolTelemetry?: unknown;
49 > mcpServerName?: string;
50 > mcpToolName?: string;
51 > toolDescription?: unknown;
52 > /** @deprecated Use the envelope-level {@link ISessionEventToolComplete.agentId} instead. */
53 > parentToolCallId?: string;
54 > };
55 > }
56 >
57 > export interface ISessionEventMessage {
58 > type: 'assistant.message' | 'user.message';
59 > /** SDK envelope-level event id, used as the protocol turn id. */
60 > id?: string;
61 > /** Envelope-level sub-agent instance id. See {@link ISessionEventToolStart.agentId}. */
62 > agentId?: string;
63 > data: {
64 > messageId?: string;
65 > interactionId?: string;
66 > content?: string;
67 > toolRequests?: readonly { toolCallId: string; name: string; arguments?: unknown; type?: 'function' | 'custom'; mcpServerName?: string; mcpToolName?: string; toolDescription?: unknown }[];
68 > reasoningOpaque?: string;
69 > reasoningText?: string;
70 > encryptedContent?: string;
71 > /** @deprecated Use the envelope-level {@link ISessionEventMessage.agentId} instead. */
72 > parentToolCallId?: string;
73 > /** Origin of the message; a non-`'user'` value marks an SDK-injected message that should be hidden. */
74 > source?: string;
75 > attachments?: readonly Attachment[];
76 > };
77 > }
78 >
79 > /** Minimal event shape for `skill.invoked`, used to synthesize a tool-style render. */
80 > export interface ISessionEventSkillInvoked {
81 > type: 'skill.invoked';
82 > id?: string;
83 > /** Envelope-level sub-agent instance id. */
84 > agentId?: string;
85 > data: {
86 > name: string;
87 > path?: string;
88 > description?: string;
89 > };
90 > }
91 >
92 > export interface ISessionEventSubagentStarted {
93 > type: 'subagent.started';
94 > /** Envelope-level sub-agent instance id resolved back to {@link ISessionEventSubagentStarted.data.toolCallId}. */
95 > agentId?: string;
96 > data: {
97 > toolCallId: string;
98 > agentName: string;
99 > agentDisplayName: string;
100 > agentDescription: string;
101 > };
102 > }
103 >
104 > export interface ISessionEventAbort {
105 > type: 'abort';
106 > /** Envelope-level sub-agent instance id. */
107 > agentId?: string;
108 > data: {
109 > reason: string;
110 > };
111 > }
112 >
113 > export interface ISessionEventAssistantTurn {
114 > type: 'assistant.turn_start' | 'assistant.turn_end';
115 > agentId?: string;
116 > data: {
117 > turnId: string;
118 > interactionId?: string;
119 > };
120 > }
121 >
122 > export interface ISessionEventSystemNotification {
123 > type: 'system.notification';
124 > id?: string;
125 > data: SessionEventPayload<'system.notification'>['data'];
126 > }
127 >
128 > /** Minimal event shape for session history mapping. */
129 > export type ISessionEvent =
130 > | ISessionEventToolStart
131 > | ISessionEventToolComplete
132 > | ISessionEventMessage
133 > | ISessionEventSubagentStarted
134 > | ISessionEventSkillInvoked
135 > | ISessionEventAbort
136 > | ISessionEventAssistantTurn
137 > | ISessionEventSystemNotification
138 > | { type: string; data?: unknown };
139 >
140 > /**
141 > * Widens ergonomic {@link ISessionEvent} test fixtures to the real SDK
142 > * {@link SessionEvent} union so they can be fed to the production
143 > * `mapSessionEvents`. The test shapes deliberately omit envelope fields the
144 > * mapper ignores (`parentId`, `timestamp`, …), so this is a safe deliberate
145 > * widening rather than a representation of real SDK events.
146 > */
147 > export function toSessionEvents(events: readonly ISessionEvent[]): SessionEvent[] {
148 > return events as unknown as SessionEvent[]; copilotTestEvents.ts ×1
149 > }