chatServiceImpl.ts ×5

Frontier kind: Code frontier

unlabeled · c_1e06e9e085b1

38 tests · 70840 LOC · 309 files · introduces 0 tests · 25 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges25 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5845 ranges70840 lines · 309 files · Browse complete extent
All tests (intent)
38 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.

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

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

Open complete file

1118
1119 async sendRequest(sessionResource: URI, request: string, options?: IChatSendRequestOptions): Promise<ChatSendResult> {
1120 > this.trace('sendRequest', `sessionResource: ${sessionResource.toString()}, message: ${request.substring(0, 20)}${request.length > 20 ? '[...]' : ''}}`); chatServiceImpl.ts
1121 >
1122 > const hasExplicitFileOrImageAttachment = [...(options?.attachedContext ?? []), ...(options?.resolvedVariables ?? [])].some(isExplicitFileOrImageVariableEntry);
1123 > if (!request.trim() && !hasExplicitFileOrImageAttachment && !options?.slashCommand && !options?.agentId && !options?.agentIdSilent) {
1124 this.trace('sendRequest', 'Rejected empty message');
1125 return { kind: 'rejected', reason: 'Empty message' };
1156 // and serialized per untitled resource — see
1157 // `_materializeUntitledSession`) before processing the request.
1158 > if (!model.hasRequests && isUntitledChatSession(sessionResource) && getChatSessionType(sessionResource) !== localChatSessionType) { chatServiceImpl.ts
1159 const materialized = await this._materializeUntitledSession(sessionResource, request, options, model);
1160 if (materialized) {
1170 const hasPendingRequest = this._pendingRequests.has(sessionResource);
1171
1172 > if (options?.queue) { chatServiceImpl.ts
1173 const queued = this.queuePendingRequest(model, sessionResource, request, options);
1174 if (!options.pauseQueue) {
1193 }
1194
1195 > const location = options?.location ?? model.initialLocation; chatServiceImpl.ts
1196 > const attempt = options?.attempt ?? 0;
1197 > const defaultAgent = this.chatAgentService.getDefaultAgent(location, options?.modeInfo?.kind);
1198 > if (!defaultAgent) {
1199 this.logService.warn('sendRequest', `No default agent for location ${location}`);
1200 return { kind: 'rejected', reason: 'No default agent available' };
1202
1203 const parsedRequest = this.parseChatRequest(sessionResource, request, location, options);
1204 > const silentAgent = options?.agentIdSilent ? this.chatAgentService.getAgent(options.agentIdSilent) : undefined; chatServiceImpl.ts
1205 > const agent = silentAgent ?? parsedRequest.parts.find((r): r is ChatRequestAgentPart => r instanceof ChatRequestAgentPart)?.agent ?? defaultAgent;
1206 > const agentSlashCommandPart = parsedRequest.parts.find((r): r is ChatRequestAgentSubcommandPart => r instanceof ChatRequestAgentSubcommandPart);
1207 >
1208 > // This method is only returning whether the request was accepted - don't block on the actual request
1209 > return {
1210 > kind: 'sent',
1211 > newSessionResource,
1212 > data: {
1213 > ...this._sendRequestAsync(model, sessionResource, parsedRequest, attempt, !options?.noCommandDetection, silentAgent ?? defaultAgent, location, options),
1214 > agent,
1215 > slashCommand: agentSlashCommandPart?.command,
1216 > },
1217 > };
1218 > }
1219
1220 /**