agentHostChangesetService.ts ×12

Frontier kind: Code frontier

unlabeled · c_bd1d0de5abfb

2 tests · 51737 LOC · 304 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5443 ranges51737 lines · 304 files · Browse complete extent
All tests (intent)
2 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: 34 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostChangesetService.ts 34 introduced LOC · 12 ranges

Open complete file

45 import { relativePath } from '../../../base/common/resources.js';
46
47 > function staticChangesetUri(session: ProtocolURI, kind: StaticChangesetKind): ProtocolURI { agentHostChangesetService.ts
48 > return kind === 'branch'
49 > ? buildBranchChangesetUri(session)
50 : buildSessionChangesetUri(session);
52
53 function persistKeyFor(kind: StaticChangesetKind): string {
325 return;
326 }
327 > this._scheduleStaticRecompute(session, 'branch', undefined, this._markStaticChangesetComputing(session, 'branch')); agentHostChangesetService.ts
328 }
329
729 */
730 private _scheduleStaticRecompute(session: ProtocolURI, kind: StaticChangesetKind, changedTurnId?: string, statusBeforeRefresh?: ChangesetStatus): void {
731 > this._diffComputationSequencer.queue(`${session}\u0000${kind}`, () => this._doComputeStaticChangeset(session, kind, changedTurnId, statusBeforeRefresh)); agentHostChangesetService.ts
732 > }
733
734 private _markStaticChangesetComputing(session: ProtocolURI, kind: StaticChangesetKind): ChangesetStatus | undefined {
735 > const changesetUri = staticChangesetUri(session, kind); agentHostChangesetService.ts
736 > this._stateManager.registerChangeset(changesetUri);
737 > const status = this._stateManager.getChangesetState(changesetUri)?.status;
738 > if (status !== ChangesetStatus.Computing) {
739 this._stateManager.dispatchServerAction(changesetUri, {
740 type: ActionType.ChangesetStatusChanged,
742 });
743 }
744 > return status; agentHostChangesetService.ts
745 > }
746
747 private async _doComputeStaticChangeset(session: ProtocolURI, kind: StaticChangesetKind, changedTurnId?: string, statusBeforeRefresh?: ChangesetStatus): Promise<void> {
748 > const changesetUri = staticChangesetUri(session, kind); agentHostChangesetService.ts
749 > this._activeStaticComputes.add(changesetUri);
750 > const statusBeforeCompute = statusBeforeRefresh ?? this._stateManager.getChangesetState(changesetUri)?.status;
751 > let ref: ReturnType<ISessionDataService['openDatabase']>;
752 > try {
753 > ref = this._sessionDataService.openDatabase(URI.parse(session));
754 > } catch (err) {
755 this._logService.warn(`[AgentHostChangesetService] Failed to open session database for ${kind} diff computation: ${session}`, err);
756 this._restoreStaticChangesetStatus(changesetUri, statusBeforeCompute);
814 ? await this._computeReviewedInfo(session, ref.object)
815 : undefined;
816 > this._publishChangesetDiffs(session, changesetUri, diffs, reviewed); agentHostChangesetService.ts
817 >
818 > // Persist the file list so a subsequent `listSessions` /
819 > // `restoreSession` can reseed the changeset before the first
820 > // post-restart compute completes.
821 > this._persistSessionFlag(session, persistKeyFor(kind), JSON.stringify(diffs));
822 >
823 > if (kind === ChangesetKind.Branch) {
824 // Migration: also overwrite the legacy `'diffs'` key with the
825 // session-changeset payload so older readers stay correct
838 this._stateManager.setSessionSummaryChanges(session, changesSummary);
839 }
840 > } catch (err) { agentHostChangesetService.ts
841 this._logService.warn(`[AgentHostChangesetService] Failed to compute ${kind} diffs`, err);
842 this._stateManager.dispatchServerAction(changesetUri, {
860 */
861 private _restoreStaticChangesetStatus(changesetUri: ProtocolURI, status: ChangesetStatus | undefined): void {
862 > if (!status || status === ChangesetStatus.Computing) { agentHostChangesetService.ts
863 > return;
864 > }
865 this._stateManager.dispatchServerAction(changesetUri, {
866 type: ActionType.ChangesetStatusChanged,
867 status,
868 });
870
871 /**