reducer.ts ×12

Frontier kind: Code frontier

unlabeled · c_a9997d83c849

186 tests · 11461 LOC · 50 files · introduces 0 tests · 43 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges43 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
709 ranges11461 lines · 50 files · Browse complete extent
All tests (intent)
186 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: 43 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.ts 43 introduced LOC · 12 ranges

Open complete file

47 * or a tool call paused on MCP authentication.
48 */
49 > function hasBlockingToolCall(state: ChatState): boolean { reducer.ts
50 > if (!state.activeTurn) {
51 return false;
52 }
53 > return state.activeTurn.responseParts.some(part => reducer.ts
54 part.kind === ResponsePartKind.ToolCall
55 && (part.toolCall.status === ToolCallStatus.PendingConfirmation
56 || part.toolCall.status === ToolCallStatus.PendingResultConfirmation
57 || part.toolCall.status === ToolCallStatus.AuthRequired),
58 > ); reducer.ts
59 > }
60
61 /** Returns whether the active turn contains an input request awaiting submission. */
62 > function hasOpenInputRequest(state: ChatState): boolean { reducer.ts
63 > return state.activeTurn?.responseParts.some(part =>
64 part.kind === ResponsePartKind.InputRequest && part.response === undefined,
65 > ) ?? false; reducer.ts
66 > }
67
68 function findOpenInputRequestPart(
86
87 /** Sets or clears a metadata flag on a status value. */
88 > function withStatusFlag(status: SessionStatus, flag: SessionStatus, set: boolean): SessionStatus { reducer.ts
89 > return set ? status | flag : status & ~flag;
90 > }
91
92 /** Derives the summary status from live session work, preserving orthogonal flags. */
93 > function summaryStatus(state: ChatState, terminalStatus?: SessionStatus.Error): SessionStatus { reducer.ts
94 > let activity: SessionStatus;
95 > if (terminalStatus) {
96 activity = terminalStatus;
97 > } else if (hasOpenInputRequest(state) || hasBlockingToolCall(state)) { reducer.ts
98 activity = SessionStatus.InputNeeded;
99 > } else if (state.activeTurn) { reducer.ts
100 > activity = SessionStatus.InProgress;
101 > } else {
102 activity = SessionStatus.Idle;
103 }
104 > reducer.ts
105 > return state.status & ~STATUS_ACTIVITY_MASK | activity;
106 > }
107
108 /**
304
305 case ActionType.ChatTurnStarted: {
306 > let next: ChatState = { reducer.ts
307 > ...state,
308 > activeTurn: {
309 > id: action.turnId,
310 > startedAt: action.startedAt,
311 > message: action.message,
312 > responseParts: [],
313 > usage: undefined,
314 > },
315 > };
316 > next = {
317 > ...next,
318 > status: withStatusFlag(summaryStatus(next), SessionStatus.IsRead, false),
319 > modifiedAt: new Date(Date.now()).toISOString(),
320 > };
321 >
322 > // If this turn was auto-started from a pending message, remove it
323 > if (action.queuedMessageId) {
324 if (next.steeringMessage?.id === action.queuedMessageId) {
325 next = { ...next, steeringMessage: undefined };
330 }
331 }
332 > reducer.ts
333 > return next;
334 > }
335
336 case ActionType.ChatDelta: