protocolServerHandler.ts ×9

Frontier kind: Code frontier

unlabeled · c_ffd71ff1d69b

14 tests · 28989 LOC · 148 files · introduces 0 tests · 22 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges22 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2831 ranges28989 lines · 148 files · Browse complete extent
All tests (intent)
14 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: 22 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/protocolServerHandler.ts 22 introduced LOC · 9 ranges

Open complete file

78
79 /** A client tool call in any of these statuses is still awaiting its result. */
80 > function isPendingToolCallStatus(status: ToolCallStatus): boolean { protocolServerHandler.ts
81 > return status === ToolCallStatus.Streaming
82 || status === ToolCallStatus.Running
83 || status === ToolCallStatus.PendingConfirmation;
85
86 /** Build a JSON-RPC success response suitable for transport.send(). */
371 // the provider, so they never reach this path.
372 if (envelope.action.type === ActionType.ChatToolCallStart || envelope.action.type === ActionType.ChatToolCallReady) {
373 > if (!isAhpChatChannel(envelope.channel)) { protocolServerHandler.ts
374 throw new Error(`[ProtocolServer] Chat tool-call action emitted on non-chat channel: ${envelope.channel}`);
375 }
376 > this._checkOrphanedClientToolCalls(parseRequiredSessionUriFromChatUri(envelope.channel), envelope.channel); protocolServerHandler.ts
377 > }
378 }));
379
878 return;
879 }
880 > for (const part of activeTurn.responseParts) { protocolServerHandler.ts
881 > if (part.kind !== ResponsePartKind.ToolCall) {
882 continue;
883 }
884 > const toolCall = part.toolCall; protocolServerHandler.ts
885 > const contributor = toolCall.contributor;
886 > if (contributor?.kind === ToolCallContributorKind.Client && isPendingToolCallStatus(toolCall.status)) {
887 > yield { toolCall, clientId: contributor.clientId };
888 > }
889 > }
890 }
891
942 */
943 private _checkOrphanedClientToolCalls(session: string, chatChannel: string): void {
944 > const state = this._stateManager.getSessionState(chatChannel); protocolServerHandler.ts
945 > const orphanOwners = new Set<string>();
946 > for (const { clientId } of this._pendingClientToolCalls(state)) {
947 > const ownerRecord = this._clients.get(clientId);
948 > if (ownerRecord?.state === 'grace') {
949 orphanOwners.add(clientId);
950 }
952 > for (const ownerId of orphanOwners) {
953 this._startClientToolCallDisconnectTimeout(ownerId, session, chatChannel);
954 }
956
957 /**