agentHostStateManager.ts ×5

Frontier kind: Code frontier

unlabeled · c_0c97e7b35155

33 tests · 19460 LOC · 83 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1854 ranges19460 lines · 83 files · Browse complete extent
All tests (intent)
33 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: 29 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostStateManager.ts 29 introduced LOC · 5 ranges

Open complete file

99 /** Whether `session` has a pending (unflushed) summary change. */
100 isDirty(session: string): boolean {
101 > return this._dirty.has(session); agentHostStateManager.ts
102 > }
103
104 /** Drops the pending dirty flag for `session` without flushing it. */
109 /** Drops all notification bookkeeping for `session`. */
110 remove(session: string): void {
111 > this._lastNotified.delete(session); agentHostStateManager.ts
112 > this._dirty.delete(session);
113 > }
114
115 private _flushAll(): void {
844 return;
845 }
847 > // Flush any pending summary notification before tearing down state so
848 > // that the final status (e.g. Idle) reaches clients even if the session
849 > // is evicted within the scheduler's debounce window.
850 > if (this._summaryNotifier.isDirty(session)) {
851 this._summaryNotifier.flush(session);
852 }
854 > // Clean up active turn tracking. We must dispatch
855 > // `RootActiveSessionsChanged` if the count actually changes so that
856 > // downstream consumers (e.g. the server lifetime tracker driving
857 > // `--enable-remote-auto-shutdown`) release their hold on the process.
858 > // Without this, evicting a session that still has an active turn
859 > // silently strands the active-sessions count above zero forever.
860 > if (this._sessionsWithActiveTurn.delete(session)) {
861 this._onDidChangeSessionActiveTurn.fire({ session, active: false });
862 this.dispatchServerAction(ROOT_STATE_URI, { type: ActionType.RootActiveSessionsChanged, activeSessions: this._sessionsWithActiveTurn.size });
863 }
865 > // Tear down every chat owned by the session, not just the default
866 > // chat: additional peer chats each hold their own ChatState.
867 > for (const chat of entry.state.chats) {
868 > this._chatStates.delete(chat.resource);
869 > this._chatProviderData.delete(chat.resource);
870 > }
871 > this._chatStates.delete(buildDefaultChatUri(session));
872 > this._sessionStates.delete(session);
873 > this._summaryNotifier.remove(session);
874 > this._logService.trace(`[AgentHostStateManager] Removed session: ${session}`);
875 }
876