protocolServerHandler.ts ×8

Frontier kind: Code frontier

unlabeled · c_170dd824b055

18 tests · 28887 LOC · 148 files · introduces 0 tests · 18 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges18 lines · 1 files
Tests
0 tests

Contains — complete concept membership

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

src/vs/platform/agentHost/node/protocolServerHandler.ts 18 introduced LOC · 8 ranges

Open complete file

817 private _handleClientDisconnected(clientId: string): void {
818 for (const session of this._stateManager.getSessionUris()) {
819 > const state = this._stateManager.getSessionState(session); protocolServerHandler.ts
820 > const isActive = state ? this._isActiveClient(state, clientId) : false;
821 > const ownsPendingToolCall = state ? this._hasPendingClientToolCall(state, clientId) : false;
822 > // Keep the client marked active during the grace window so a quick
823 > // reconnect that resubscribes can retain its slot. The disconnect
824 > // timeout removes the active client (and fails its pending tool
825 > // calls) if it never returns; an explicit unsubscribe or a
826 > // reconnect without resubscription removes it sooner.
827 > if (isActive || ownsPendingToolCall) {
828 for (const chat of state?.chats ?? []) {
829 this._startClientToolCallDisconnectTimeout(clientId, session, chat.resource);
830 }
831 }
833 }
834
835 /** Whether `clientId` is one of the session's active clients. */
836 private _isActiveClient(state: SessionState, clientId: string): boolean {
837 > return state.activeClients.some(c => c.clientId === clientId); protocolServerHandler.ts
838 > }
839
840 /**
891
892 private _hasPendingClientToolCall(state: ISessionWithDefaultChat | undefined, clientId: string): boolean {
893 > for (const pending of this._pendingClientToolCalls(state)) { protocolServerHandler.ts
894 if (pending.clientId === clientId) {
895 return true;
897 }
898 return false;
900
901 private _hasReplacementActiveClientTool(state: SessionState, clientId: string, toolName: string): boolean {
1020
1021 private _hasSubscriptionInOtherConnection(record: IClientRecord, client: IConnectedClient, uri: string): boolean {
1022 > if (record.state !== 'active') { protocolServerHandler.ts
1023 return false;
1024 }
1025 > for (const other of record.connections) { protocolServerHandler.ts
1026 if (other !== client && other.subscriptions.has(uri)) {
1027 return true;
1028 }
1029 }
1030 > return false; protocolServerHandler.ts
1031 > }
1032
1033 /** Number of clients that currently have a live connection. */