* persisted on dispose so the draft survives switching sessions.
*/
const state = model.inputModel.state.get();
if (!state) {
return false;
}
Frontier kind: Code frontier
unlabeled · c_4cc8b5e1156f
30 tests · 71007 LOC · 309 files · introduces 0 tests · 64 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/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService untitled session materialization is idempotent/serialized (avoids duplicate sessions) a failed materialization does not poison the latch (retry re-attempts)|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService untitled session materialization is idempotent/serialized (avoids duplicate sessions) a load failure after alias registration does not poison the late-send re-target|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/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: 64 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
* persisted on dispose so the draft survives switching sessions.
*/
const state = model.inputModel.state.get();
if (!state) {
return false;
}
return undefined;
}
const providedSession = await this.chatSessionService.getOrCreateChatSession(sessionResource, token);
// Make sure we haven't created this in the meantime
{
const existingRef = this.acquireExistingSession(sessionResource, debugOwner);
if (existingRef) {
return existingRef;
}
}
const modelId = findLast(providedSession.history.filter(m => m.type === 'request'), req => req.modelId)?.modelId;
const agentUri = findLast(providedSession.history.filter(m => m.type === 'request'), req => req.modeInstructions?.uri)?.modeInstructions?.uri;
const storedMetadata = this._chatSessionStore.getMetadataForSessionSync(sessionResource);
};
}
// Contributed sessions do not use UI tools.
// Prefer (in order): a transferred draft, the persisted draft from metadata,
// otherwise let the constructor fall back to initialData.value.inputState.
// When restoring the persisted draft we keep the unsent text/selections/mode but
// deliberately drop its persisted selectedModel identifier (it can be stale or belong
// to a different model pool) in favour of the model derived from the session's request
// history. The user's per-model configuration (thinking effort, context window) is
// carried over onto that history-derived model above when the ids match. When no
// history model is available the model is left undefined so the input part resolves
// it via its own selection logic.
const restoredDraft: ISerializableChatModelInputState | undefined = storedInputState
? { ...storedInputState, selectedModel: historyDerivedModel }
// At cold restore the agent-host transferred draft can drop the user's per-session picker
// selections (model/mode); restore them from the session's own saved `storedInputState`
const stateToApply = transferredInputState
? backfillTransferredModel(transferredInputState, historyDerivedModel)
const inputState = backfillRestoredPickerState(stateToApply, storedInputState, ChatMode.Agent.id);
const modelRef = this._sessionModels.acquireOrCreate({
modelRef.object.inputModel.setState({ permissionLevel: storedPermissionLevel });
}
if (providedSession.title) {
modelRef.object.setCustomTitle(providedSession.title);
}
const model = modelRef.object;
const disposables = new DisposableStore();
disposables.add(modelRef.object.onDidDispose(() => {
disposables.dispose();
providedSession.dispose();
}));
const isAgentHostSession = isAgentHostTarget(chatSessionType);
const requestParser = isAgentHostSession ? this.instantiationService.createInstance(ChatRequestParser) : undefined;
const parseAgentHostHistoryPrompt = (text: string, agent: IChatAgentData | undefined): IParsedChatRequest => {
}
}
// Set up progress streaming and cancellation for contributed sessions.
// This handles both the initial in-flight response (from session load)
// and any subsequent server-initiated turns (e.g. consumed queued messages).
const hasProgressStreaming = providedSession.progressObs && providedSession.interruptActiveResponseCallback;
if (hasProgressStreaming) {
let lastProgressLength = 0;
}
}));
if (providedSession.isCompleteObs?.get()) {
completeLastResponse();
registerChatSessionContentProvider(chatSessionType: string, provider: IChatSessionContentProvider): IDisposable {
this._onDidChangeContentProviderSchemes.fire({ added: [chatSessionType], removed: [] });
return {
dispose: () => {
this.contentProviders.delete(chatSessionType);
}
};
}
async canResolveContentProvider(chatSessionType: string): Promise<boolean> {
async getOrCreateChatSession(sessionResource: URI, token: CancellationToken): Promise<IChatSession> {
const provider = this.contentProviders.get(sessionType);
if (!provider) {
throw new Error(`No content provider for ${sessionType}`);
}
}
async canResolveChatSession(sessionType: string): Promise<boolean> {
getMetadataForSessionSync(sessionResource: URI): IChatSessionEntryMetadata | undefined {
return index.entries[this.getIndexKey(sessionResource)];
}
private getIndexKey(sessionResource: URI): string {
const sessionId = LocalChatSessionUri.parseLocalSessionId(sessionResource);
chatSessionStore.ts
return sessionId ?? sessionResource.toString();
}
logIndex(): void {