return kind === 'branch'
? buildBranchChangesetUri(session)
}
return kind === 'branch'
? META_CHANGESET_BRANCH
}
/**
Frontier kind: Joint frontier
unlabeled · c_967cc1ccf651
1 test · 52220 LOC · 304 files · introduces 1 test · 109 LOC · 2 files
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.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/buffer.test|title=Buffer fromString|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/buffer.test|title=Buffer issue #251527 - VSBuffer#toString preserves BOM character in filenames|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentHostSchema.test|title=agentHostSchema createSchema toProtocol emits a JSON-Schema-compatible object|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentHostSchema.test|title=agentHostSchema platformSessionSchema exposes approval choices in picker order with current copy|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
1 test introduced at this concept.
Every collected source range enters the hierarchy at exactly one concept.
2 files ranked by introduced lines: 109 introduced LOC across 26 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
return kind === 'branch'
? buildBranchChangesetUri(session)
}
return kind === 'branch'
? META_CHANGESET_BRANCH
}
/**
return;
}
this._scheduleStaticRecompute(session, 'session', undefined, this._markStaticChangesetComputing(session, 'session'));
agentHostChangesetService.ts
}
return;
}
try {
let diffs = await this._tryComputeGitDiffs(session, ref.object, kind);
if (!diffs) {
if (kind === 'branch') {
// Branch changeset answers a different question than the
// edit-tracker aggregator — do not fall back. Preserve
// whatever cached state is already there.
this._logService.debug(`[AgentHostChangesetService] Branch git diff unavailable for ${session}; preserving cached changeset. previousStatus=${statusBeforeCompute ?? 'unknown'} cachedFiles=${this._stateManager.getChangesetState(changesetUri)?.files.length ?? 0}`);
this._restoreStaticChangesetStatus(changesetUri, statusBeforeCompute);
return;
}
// `session` kind: working-tree git is unavailable (no
// working dir or not a git work tree). Fall back to the
// edit-tracker aggregator — for the session changeset the
// SDK-tracked edits are the best available approximation.
//
// In multi-chat sessions each peer chat records its file
// edits into its OWN database (the chat URI is used as the
// session URI for that chat's edit tracker). Union the
// session DB with every peer chat DB so peer-chat edits roll
// up into the session-level changes.
const peerSources = this._openPeerChatSources(session);
try {
if (peerSources.length > 0) {
const sources: ISessionDiffSource[] = [
{ sessionUri: session, db: ref.object },
// and the tracking issue.
diffs = await computeUnionedDiffs(sources, this._diffComputeService);
let incremental: IIncrementalDiffOptions | undefined;
if (changedTurnId) {
const previousDiffs = this._readPreviousChangesetDiffs(changesetUri);
if (previousDiffs) {
}
}
diffs = await computeSessionDiffs(session, ref.object, this._diffComputeService, incremental);
agentHostChangesetService.ts
}
} finally {
for (const peer of peerSources) {
peer.ref.dispose();
}
}
const reviewed = kind === ChangesetKind.Branch
? await this._computeReviewedInfo(session, ref.object)
this._publishChangesetDiffs(session, changesetUri, diffs, reviewed);
error: { errorType: 'computeFailed', message: err instanceof Error ? err.message : String(err) },
});
this._activeStaticComputes.delete(changesetUri);
this._stateManager.onChangesetLivenessChanged();
ref.dispose();
}
}
*/
private _openPeerChatSources(session: ProtocolURI): { sessionUri: ProtocolURI; ref: ReturnType<ISessionDataService['openDatabase']> }[] {
const chats = this._stateManager.getSessionState(session)?.chats ?? [];
agentHostChangesetService.ts
const sources: { sessionUri: ProtocolURI; ref: ReturnType<ISessionDataService['openDatabase']> }[] = [];
for (const chat of chats) {
if (isDefaultChatUri(chat.resource)) {
continue;
}
try {
const ref = this._sessionDataService.openDatabase(URI.parse(chat.resource));
this._logService.warn(`[AgentHostChangesetService] Failed to open peer chat database for session changes: ${chat.resource}`, err);
}
return sources;
}
/**
*/
private _latestTurnIdAcrossChats(session: ProtocolURI): string | undefined {
const sessionState = this._stateManager.getSessionState(session);
agentHostChangesetService.ts
if (!sessionState) {
return undefined;
}
const chats = sessionState.chats ?? [];
if (chats.length <= 1) {
return sessionState.turns.at(-1)?.id;
}
let bestTurnId: string | undefined;
*/
private async _tryComputeGitDiffs(session: ProtocolURI, db: ISessionDatabase, kind: StaticChangesetKind): Promise<readonly ISessionFileDiff[] | undefined> {
const workingDirectory = this._stateManager.getSessionState(session)?.workingDirectories?.[0];
agentHostChangesetService.ts
if (!workingDirectory) {
return undefined;
}
let workingDirectoryUri: URI;
try {
workingDirectoryUri = URI.parse(workingDirectory);
} catch {
return undefined;
}
// Session
if (kind === 'session') {
// Get session checkpoints. In multi-chat sessions the working tree
// is shared and each chat's turn checkpoints are stored under the
// session URI keyed by their turn id, so the most-recently-modified
// chat's last turn captures the full working-tree delta.
const latestTurnId = this._latestTurnIdAcrossChats(session);
if (!latestTurnId) {
return undefined;
}
const sessionUri = URI.parse(session);
this._checkpointService.getTurnCheckpointPair(sessionUri, latestTurnId),
]);
return undefined;
}
return undefined;
}
// Branch
const baseBranch = await this._resolveBranchBaseBranch(session, db);
try {
return await this._gitService.computeSessionFileDiffs(workingDirectoryUri, {
sessionUri: session,
baseBranch
});
} catch (err) {
this._logService.warn(`[AgentHostChangesetService] git-driven ${kind} diff computation failed; falling back to edit-tracker`, err);
return undefined;
}
/**
*/
private async _resolveBranchBaseBranch(session: ProtocolURI, db: ISessionDatabase): Promise<string | undefined> {
const persistedBaseBranch = await db.getMetadata(META_DIFF_BASE_BRANCH);
agentHostChangesetService.ts
const gitStateBaseBranch = readSessionGitState(this._stateManager.getSessionState(session)?._meta)?.baseBranchName;
if (!persistedBaseBranch && gitStateBaseBranch) {
this._logService.debug(`[AgentHostChangesetService] Using _meta.git base branch fallback for Branch Changes in ${session}: ${gitStateBaseBranch}`);
}
return resolveDiffBaseBranchName(persistedBaseBranch, gitStateBaseBranch);
agentHostChangesetService.ts
}
/**
*/
private _persistSessionFlag(session: ProtocolURI, key: string, value: string): void {
const ref = this._sessionDataService.openDatabase(URI.parse(session));
agentHostChangesetService.ts
ref.object.setMetadata(key, value).catch(err => {
this._logService.warn(`[AgentHostChangesetService] Failed to persist ${key}`, err);
ref.dispose();
});
}
}
gitState = readSessionGitState(sessionState?._meta);
if (!gitState) {
}
}