chatServiceImpl.ts ×5

Frontier kind: Code frontier

unlabeled · c_32d4c95092c7

12 tests · 72253 LOC · 309 files · introduces 0 tests · 25 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges25 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
6216 ranges72253 lines · 309 files · Browse complete extent
All tests (intent)
12 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.

2 files ranked by introduced lines: 25 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 23 introduced LOC · 5 ranges

Open complete file

1953 // Use a single-entry history based on the current request (no full chat history).
1954 if (model.getRequests().length !== 1 || model.customTitle) {
1955 > return; chatServiceImpl.ts
1956 > }
1957
1958 const singleEntryHistory: IChatAgentHistoryEntry[] = [{
1995 const agent = this.chatAgentService.getAgent(forAgentId);
1996 for (const request of requests) {
1997 > if (!request.response) { chatServiceImpl.ts
1998 continue;
1999 }
2001 > if (forAgentId !== request.response.agent?.id && !agent?.isDefault && !agent?.canAccessPreviousChatHistory) {
2002 // An agent only gets to see requests that were sent to this agent.
2003 // The default agent (the undefined case), or agents with 'canAccessPreviousChatHistory', get to see all of them.
2004 continue;
2005 }
2007 > // Do not save to history inline completions
2008 > if (location === ChatAgentLocation.EditorInline) {
2009 continue;
2010 }
2012 > const promptTextResult = getPromptText(request.message);
2013 > const historyRequest: IChatAgentRequest = {
2014 > sessionResource: request.session.sessionResource,
2015 > requestId: request.id,
2016 > agentId: request.response.agent?.id ?? '',
2017 > message: promptTextResult.message,
2018 > command: request.response.slashCommand?.name,
2019 > variables: updateRanges(request.variableData, promptTextResult.diff), // TODO bit of a hack
2020 > location: ChatAgentLocation.Chat,
2021 > editedFileEvents: request.editedFileEvents,
2022 > modeInstructions: request.modeInfo?.modeInstructions,
2023 > };
2024 > history.push({ request: historyRequest, response: toChatHistoryContent(request.response.response.value), result: request.response.result ?? {} });
2025 > }
2026
2027 return history;
src/vs/workbench/contrib/chat/common/model/chatModel.ts 2 introduced LOC · 1 range

Open complete file

248
249 export function toChatHistoryContent(content: ReadonlyArray<IChatProgressResponseContent>): IChatProgressHistoryResponseContent[] {
250 > return content.filter(isChatProgressHistoryResponseContent); chatModel.ts
251 > }
252
253 export type IChatProgressRenderableResponseContent = Exclude<IChatProgressResponseContent, IChatContentInlineReference | IChatAgentMarkdownContentWithVulnerability | IChatResponseCodeblockUriPart>;