src/vs/platform/agentHost/common/state/sessionReducers.ts

22 LOC · 20 covered · 2 uncovered · 1 ranges · 3225 concepts · 1 introducers · 1445 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 file §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 · 0 introduced LOC §3.8 — permissionMode p…claudeCanUseTool.ts ×1 · 2 introduced LOCclaudeCanUseTool.ts ×1agentService.ts ×2 · 4 introduced LOCagentService.ts ×2claudeAgent.ts ×5 · 11 introduced LOCclaudeAgent.ts ×5agentService.ts ×10 · 47 introduced LOCagentService.ts ×10agentService.ts ×1 · 2 introduced LOCagentService.ts ×1agentHostChangesetCoordinator.ts ×1 · 3 introduced LOCagentHostChangesetCoordi…mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1 · 0 introduced LOCmcpCustomizationControll…agentHostStateManager.test|title=AgentHostStateManager does not emit sessionSummaryChanged for deleted session|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=AgentHostStateManager emits sessionSummaryChanged when summary changes|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=AgentHostStateManager serverSeq increments monotonically|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1, agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostStateManager.test|title=AgentHostStateManager multi-chat catalog session title and default chat title stay independent once multi-chat|occurrence=1 · 0 introduced LOCagentHostStateManager.te…sessionServerTools.ts ×2 · 19 introduced LOCsessionServerTools.ts ×2agentHostTerminalManager.ts ×41 · 285 introduced LOCagentHostTerminalManager…reducer.ts ×1 · 6 introduced LOCreducer.ts ×1sessionServerTools.ts ×10 · 12 introduced LOCsessionServerTools.ts ×1…sessionServerTools.ts ×1 · 2 introduced LOCsessionServerTools.ts ×1sessionServerTools.ts ×9 · 60 introduced LOCsessionServerTools.ts ×9agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1 · 0 introduced LOCagentHostStateManager.te…sessionState.ts ×1 · 3 introduced LOCsessionState.ts ×1agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1, +1 · 0 introduced LOCagentHostStateManager.te…sessionServerTools.ts ×1 · 2 introduced LOCsessionServerTools.ts ×1agentServerToolHost.ts ×2 · 12 introduced LOCagentServerToolHost.ts ×…agentHostStateManager.ts ×3 · 11 introduced LOCagentHostStateManager.ts…sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1agentHostStateManager.ts ×4 · 40 introduced LOCagentHostStateManager.ts…agentFeedbackServerTools.ts ×1 · 2 introduced LOCagentFeedbackServerTools…agentServerToolHost.ts ×5 · 117 introduced LOCagentServerToolHost.ts ×…sessionState.ts ×1 · 11 introduced LOCsessionState.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1agentHostStateManager.ts ×60 · 753 introduced LOCagentHostStateManager.ts…agentSubscription.ts ×16 · 62 introduced LOCagentSubscription.ts ×16agentSubscription.ts ×2 · 7 introduced LOCagentSubscription.ts ×2agentSubscription.ts ×3 · 3 introduced LOCagentSubscription.ts ×3agentSubscription.ts ×1 · 10 introduced LOCagentSubscription.ts ×1agentSubscription.ts ×7 · 36 introduced LOCagentSubscription.ts ×7reducer.ts ×1 · 8 introduced LOCreducer.ts ×1reducer.ts ×1 · 1 introduced LOCreducer.ts ×1sessionState.ts ×2 · 32 introduced LOCsessionState.ts ×2sessionActions.ts ×1 · 2 introduced LOCsessionActions.ts ×1sessionActions.ts ×1 · 2 introduced LOCsessionActions.ts ×1sessionActions.ts ×1 · 2 introduced LOCsessionActions.ts ×1sessionReducers.ts ×1 · 20 introduced LOCsessionReducers.ts ×1agentSubscription.test|title=AgentSubscriptionManager dispatchOptimistic applies to matching changeset subscription|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentSubscription.test|title=AgentSubscriptionManager dispatchOptimistic applies to matching changeset subscription|occurrence=1agentSubscription.test|t…agentSubscription.test|title=ChatStateSubscription server terminal turn action drops stale optimistic turn start|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentSubscription.test|title=ChatStateSubscription server terminal turn action drops stale optimistic turn start|occurrence=1agentSubscription.test|t…agentSubscription.test|title=SessionStateSubscription applyOptimistic returns clientSeq and updates value but not verifiedValue|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentSubscription.test|title=SessionStateSubscription applyOptimistic returns clientSeq and updates value but not verifiedValue|occurrence=1agentSubscription.test|t…agentFeedbackServerTools.test|title=AgentFeedbackServerTools AgentServerToolHost advertise publishes the server tools as server tools|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentFeedbackServerTools.test|title=AgentFeedbackServerTools AgentServerToolHost advertise publishes the server tools as server tools|occurrence=1agentFeedbackServerTools…mutate tools do not|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentFeedbackServerTools.test|title=AgentFeedbackServerTools viewUnreviewedComments requires confirmation; the read/mutate tools do not|occurrence=1mutate tools do not|occu…agentHostStateManager.test|title=AgentHostStateManager does not emit sessionSummaryChanged for deleted session|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager does not emit sessionSummaryChanged for deleted session|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=AgentHostStateManager emits sessionSummaryChanged when summary changes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager emits sessionSummaryChanged when summary changes|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=AgentHostStateManager multi-chat catalog session title and default chat title stay independent once multi-chat|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager multi-chat catalog session title and default chat title stay independent once multi-chat|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=AgentHostStateManager serverSeq increments monotonically|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager serverSeq increments monotonically|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix creates state manager prefix|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix creates state manager prefix|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix preserves parent URI path shape|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix preserves parent URI path shape|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when the chat does not override it|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when the chat does not override it|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1agentHostStateManager.te…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1agentHostTerminalManager…agentService.test|title=AgentService (node dispatcher) aggregation listSessions never returns subagent sessions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) aggregation listSessions never returns subagent sessions|occurrence=1agentService.test|title=…agentService.test|title=AgentService (node dispatcher) subscriber refcount eviction depth-2 subagent unsubscribe evicts the root session state|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) subscriber refcount eviction depth-2 subagent unsubscribe evicts the root session state|occurrence=1agentService.test|title=…claudeAgent.test|title=ClaudeAgent (Phase 7 §3.4 — _handleCanUseTool) SDK abort signal already aborted on entry returns deny without parking|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent (Phase 7 §3.4 — _handleCanUseTool) SDK abort signal already aborted on entry returns deny without parking|occurrence=1claudeAgent.test|title=C… §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent (Phase 7 §3.6 / §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 §3.8 — permissionMode p…claudeAgent.test|title=ClaudeAgent — Phase 11 customizations createChat({ sideChat }) falls back to injected source context when the source transcript is unavailable|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent — Phase 11 customizations createChat({ sideChat }) falls back to injected source context when the source transcript is unavailable|occurrence=1claudeAgent.test|title=C…sessionServerTools.test|title=SessionServerTools definitions and confirmation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools definitions and confirmation|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context execute reads from the accessor; cold session returns identity + empty transcript|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context execute reads from the accessor; cold session returns identity + empty transcript|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context summary returns per-turn gists (message + reply snippet), no tool calls|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context summary returns per-turn gists (message + reply snippet), no tool calls|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context transcriptLimit drops older turns and flags truncated|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context transcriptLimit drops older turns and flags truncated|occurrence=1sessionServerTools.test|…mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/shared/mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1mcpCustomizationControll…Focused file · src/vs/platform/agentHost/common/state/sessionReducers.ts · 22 LOCstate/sessionReducers.ts

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 > /*--------------------------------------------------------------------------------------------- sessionReducers.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 > // Re-exports the protocol reducers and adds VS Code-specific helpers.
7 > // The actual reducer logic lives in the auto-generated protocol layer.
8 >
9 > // Re-export reducers from the protocol layer
10 > export { rootReducer, sessionReducer, chatReducer, changesetReducer, annotationsReducer, softAssertNever, isClientDispatchable } from './protocol/reducers.js';
11 >
12 > import { readToolCallMeta, type ToolKind } from '../meta/agentToolCallMeta.js';
13 > import type { ICompletedToolCall, ToolCallState } from './sessionState.js';
14 >
15 > /**
16 > * Extracts the VS Code-specific `toolKind` hint from a tool call's `_meta`
17 > * bag. This is not part of the protocol and is injected by the agent adapter
18 > * (e.g. `copilotEventMapper`).
19 > */
20 > export function getToolKind(tc: ToolCallState | ICompletedToolCall): ToolKind | undefined {
21 return readToolCallMeta(tc).toolKind;
22 }