// provider runtime. A zero grace releases on the next tick.
this._pendingSessionRelease.set(resource, disposableTimeout(() => {
this._maybeEvictIdleSession(resource);
}, SESSION_RELEASE_GRACE_MS));
}
Frontier kind: Code frontier
unlabeled · c_849920c18711
6 tests · 51745 LOC · 304 files · introduces 0 tests · 47 LOC · 3 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/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix creates state manager prefix|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix preserves parent URI path shape|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when the chat does not override it|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - fixed args|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - simple clase|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.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 47 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
// provider runtime. A zero grace releases on the next tick.
this._pendingSessionRelease.set(resource, disposableTimeout(() => {
this._maybeEvictIdleSession(resource);
}, SESSION_RELEASE_GRACE_MS));
}
*/
private _maybeEvictIdleSession(resource: URI): void {
if (this._resourceSubscribers.has(resource)) {
return;
}
// owned by the root session, so eviction must target the root.
let evictionTarget = resource;
{
let parsed;
while ((parsed = parseSubagentSessionUri(evictionTarget))) {
evictionTarget = parsed.parentSession;
}
// Don't evict if the root or any of its subagent descendants still has subscribers.
if (this._resourceSubscribers.has(evictionTarget)) {
return;
}
if (this._isSubagentDescendantOf(subscribedUri, evictionTarget)) {
return;
}
}
// A restore/resume racing this unsubscribe means a client is about to
// observe the session again; releasing now would tear down state that
// the in-flight rehydrate is populating.
if (this._restoreSessionInFlight.has(evictionTargetKey)) {
return;
}
if (!targetState || targetState.activeTurn !== undefined) {
return;
}
this._logService.info(`[AgentService] Evicting idle session: ${evictionTargetKey} (triggered by unsubscribe of ${key})`);
agentService.ts
// Also evict any sibling subagent entries cached under the parent: their
// authoritative state is the parent's turn tree, and dropping the parent
// would leave them orphaned.
const subagentPrefix = buildSubagentSessionUriPrefix(evictionTarget);
for (const cachedKey of this._stateManager.getSessionUrisWithPrefix(subagentPrefix)) {
this._stateManager.removeSession(cachedKey);
}
// Release the provider's in-memory SDK session in lockstep with the
// cached state. Non-destructive: durable data is preserved so the
// session resumes transparently on the next access. Fire-and-forget —
// the provider sequences the release internally and re-checks its own
// invariants (e.g. a turn that started after this call).
const provider = this._findProviderForSession(evictionTarget);
provider?.releaseSession?.(evictionTarget).catch(err => {
this._logService.error(err, `[AgentService] Failed to release idle session ${evictionTargetKey}`);
}
// Returns true when a changeset is safe to drop from the in-memory cache.
*/
getSessionUrisWithPrefix(prefix: string): string[] {
for (const key of this._sessionStates.keys()) {
if (key.startsWith(prefix)) {
result.push(key);
}
return result;
}
// ---- Snapshots ----------------------------------------------------------
async releaseSession(session: URI): Promise<void> {
// so a later restore/resume still finds its durable data.
this.releaseSessionCalls.push(session);
}
async abortSession(session: URI): Promise<void> {