chatServiceImpl.ts ×3

Frontier kind: Joint frontier

unlabeled · c_df8675a256a4

3 tests · 72247 LOC · 309 files · introduces 1 test · 48 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges48 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
6257 ranges72247 lines · 309 files · Browse complete extent
All tests (intent)
3 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 48 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 48 introduced LOC · 3 ranges

Open complete file

695 let historyDerivedModel: ISerializableChatModelInputState['selectedModel'] = undefined;
696 if ((modelId || agentUri)) {
697 > const mode: ISerializableChatModelInputState['mode'] = agentUri ? { kind: ChatModeKind.Agent, id: agentUri.toString() } : { kind: ChatModeKind.Agent, id: ChatMode.Agent.id }; chatServiceImpl.ts
698 > const modelMetadata = modelId ? this.languageModelsService.lookupLanguageModel(modelId) : undefined;
699 > // The session request history only tells us which model id was last used, not the
700 > // user's per-model configuration (e.g. thinking effort, context window). Preserve that
701 > // configuration from the persisted draft when it refers to the same model, so reopening
702 > // the session restores the full model config and not just the bare model id. Older drafts
703 > // stored the configuration as a sibling of `selectedModel` (legacy top-level field) rather
704 > // than nested within it, so fall back to that for backwards compatibility.
705 > const storedModelConfiguration = storedInputState?.selectedModel?.modelConfiguration
706 > ?? (storedInputState as { modelConfiguration?: IStringDictionary<unknown> } | undefined)?.modelConfiguration;
707 > const modelConfiguration = storedInputState?.selectedModel?.identifier === modelId
708 ? storedModelConfiguration
709 > : undefined; chatServiceImpl.ts
710 > // When the live model list has not loaded yet (cold restore) `lookupLanguageModel`
711 > // returns undefined. Don't discard the known model: fall back to the session's saved
712 > // draft model, which carries the full serialized metadata (including
713 > // `targetChatSessionType`), when it refers to the same id the request history reports
714 > // as last used. Handing the input part a model-with-metadata lets it wait for the
715 > // model pool and apply it once it loads, instead of falling back to Auto.
716 > const storedSelectedModel = storedInputState?.selectedModel;
717 > const selectedModel: ISerializableChatModelInputState['selectedModel'] = modelId && modelMetadata
718 > ? { identifier: modelId, metadata: modelMetadata, modelConfiguration }
719 : (modelId && storedSelectedModel && storedSelectedModel.identifier === modelId
720 ? { ...storedSelectedModel, modelConfiguration }
721 : undefined);
722 > historySelectedModel = selectedModel?.identifier; chatServiceImpl.ts
723 > historyDerivedModel = selectedModel;
724 > // This is used to initialize the state of the chat input box, with the selected model, mode, etc
725 > initialData = {
726 > serializer: new ChatSessionOperationLog(),
727 > value: {
728 > creationDate: Date.now(),
729 > initialLocation: undefined,
730 > customTitle: undefined,
731 > requests: [],
732 > responderUsername: '',
733 > sessionId: '',
734 > version: 3,
735 > inputState: {
736 > attachments: [],
737 > contrib: {},
738 > inputText: '',
739 > mode,
740 > selectedModel: selectedModel,
741 > selections: [],
742 > permissionLevel: storedPermissionLevel,
743 > },
744 > pendingRequests: undefined,
745 > repoData: undefined
746 > }
747 > };
748 > }
749
750 // Contributed sessions do not use UI tools.