agentSideEffects.ts ×4

Frontier kind: Code frontier

unlabeled · c_618b447e762b

17 tests · 43014 LOC · 238 files · introduces 0 tests · 44 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges44 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4151 ranges43014 lines · 238 files · Browse complete extent
All tests (intent)
17 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: 44 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

733
734 if (action.type === ActionType.ChatTurnComplete) {
735 > this._turnTracker.turnCompleted(sessionKey, turnId, 'success'); agentSideEffects.ts
736 > this._toolCallTracker.clearSession(sessionKey);
737 > this._runTurnCompleteSideEffects(sessionKey, turnId);
738 > }
739
740 if (action.type === ActionType.ChatTurnCancelled) {
757 */
758 private _runTurnCompleteSideEffects(sessionKey: ProtocolURI, turnId: string | undefined): void {
759 > // Checkpoints, changesets and the host git-refresh notification are agentSideEffects.ts
760 > // scoped to the owning session's working tree, which peer chats
761 > // share. Normalize an additional-chat channel to its session for
762 > // those, while keeping the original channel for per-chat queued
763 > // message consumption (queues live on the chat state). For the
764 > // default chat / single-chat case `sessionKey` is already the
765 > // session URI, so this is a no-op.
766 > const sessionUri = isAhpChatChannel(sessionKey) ? parseRequiredSessionUriFromChatUri(sessionKey) : sessionKey;
767 > // Capture the end-of-turn git checkpoint BEFORE notifying the
768 > // changeset service so the per-turn changeset recompute can take
769 > // the authoritative git-diff fast path (which includes terminal-tool
770 > // edits the FileEditTracker misses). The capture is best-effort —
771 > // any failure logs and the changeset pipeline falls back to the
772 > // `file_edits`-based path. We don't block subsequent side effects
773 > // (queued message drain, host notification) on the changeset
774 > // completion since those have always been fire-and-forget; the
775 > // ordering guarantee we care about is checkpoint-then-changeset.
776 > if (turnId !== undefined) {
777 > this._checkpointService.captureTurnCheckpoint(URI.parse(sessionUri), turnId).then(() => {
778 > this._changesets.onTurnComplete(sessionUri, turnId);
779 > }, err => {
780 this._logService.warn(`[AgentSideEffects] Turn checkpoint capture failed for ${sessionUri}/${turnId}: ${err instanceof Error ? err.message : String(err)}`);
781 this._changesets.onTurnComplete(sessionUri, turnId);
783 > } else {
784 this._changesets.onTurnComplete(sessionUri, turnId);
785 }
786 > this._tryConsumeNextQueuedMessage(sessionKey); agentSideEffects.ts
787 > this._options.onTurnComplete(sessionUri);
788 >
789 > // After the first turn completes, refine the auto-generated title using
790 > // the full first-turn context (request + response). No-op for later
791 > // turns or when the title has since been changed. `sessionKey` may be an
792 > // additional chat channel; route it as `chatChannel` so the refinement
793 > // targets that chat's title, mirroring `seedTitleFromFirstMessage`.
794 > const titleChatChannel = isAhpChatChannel(sessionKey) && !isDefaultChatUri(sessionKey) ? sessionKey : undefined;
795 > this._titleController.refineTitleFromFirstTurn(sessionUri, titleChatChannel);
796 >
797 > // A completed turn produces new output the user may not have seen. Route
798 > // subagent turns to their owning session too (a background subagent can
799 > // complete after the parent turn). Each client keeps its active session
800 > // read; `_markSessionUnread` is idempotent.
801 > this._markSessionUnread(sessionUri);
802 > }
803
804 private _markSessionUnread(session: ProtocolURI): void {