agentSideEffects.ts ×4

Frontier kind: Code frontier

unlabeled · c_62df16598a4f

5 tests · 49593 LOC · 291 files · introduces 0 tests · 21 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges21 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5044 ranges49593 lines · 291 files · Browse complete extent
All tests (intent)
5 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.

2 files ranked by introduced lines: 21 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentSideEffects.ts 19 introduced LOC · 4 ranges

Open complete file

1229 }
1230 case ActionType.ChatTruncated: {
1231 > if (!chatChannel) { agentSideEffects.ts
1232 throw new Error(`ChatTruncated must be handled on an AHP chat channel: ${channel}`);
1233 }
1234 > const agent = this._options.getAgent(sessionChannel); agentSideEffects.ts
1235 > // When the truncation boundary is a host-injected local turn
1236 > // (`/rename` / `!command`), redirect the SDK truncation to the
1237 > // preceding concrete turn so the agent keeps everything up to
1238 > // the real message before it.
1239 > const sdkTurnId = action.turnId !== undefined
1240 ? this._options.localTurns.resolveConcreteTurnId(chatChannel, action.turnId)
1241 : action.turnId;
1242 > // Route to the chat being truncated: the default chat (addressed agentSideEffects.ts
1243 > // by the session) or a peer chat with its own backing.
1244 > agent?.truncateSession?.(URI.parse(sessionChannel), sdkTurnId, URI.parse(chatChannel)).catch(err => {
1245 this._logService.error('[AgentSideEffects] truncateSession failed', err);
1246 > }); agentSideEffects.ts
1247 > // Drop persisted local turns that no longer survive in the
1248 > // (already-truncated) chat state.
1249 > const survivingIds = new Set((this._stateManager.getChatState(chatChannel)?.turns ?? []).map(t => t.id));
1250 > const removed = this._options.localTurns.getLocalTurnIds(chatChannel).filter(id => !survivingIds.has(id));
1251 > this._options.localTurns.deleteLocals(sessionChannel, removed);
1252 > this._changesets.onSessionTruncated(sessionChannel);
1253 > break;
1254 > }
1255 case ActionType.SessionActiveClientSet: {
1256 const agent = this._options.getAgent(channel);
src/vs/platform/agentHost/test/node/mockAgent.ts 2 introduced LOC · 1 range

Open complete file

187
188 async truncateSession(session: URI, turnId?: string, chat?: URI): Promise<void> {
189 > this.truncateSessionCalls.push({ session, turnId, chat }); mockAgent.ts
190 > }
191
192 respondToPermissionRequest(requestId: string, approved: boolean): void {