chatServiceImpl.ts ×6

Frontier kind: Code frontier

unlabeled · c_3019d017183f

32 tests · 71423 LOC · 309 files · introduces 0 tests · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges36 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5995 ranges71423 lines · 309 files · Browse complete extent
All tests (intent)
32 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: 36 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 36 introduced LOC · 6 ranges

Open complete file

1847 */
1848 private processNextPendingRequest(model: ChatModel): void {
1849 > // Agent host sessions delegate queue management to the server. chatServiceImpl.ts
1850 > // The server dispatches ChatTurnStarted with queuedMessageId when
1851 > // it consumes a queued message, so the client should not dequeue eagerly.
1852 > if (this._isServerManagedQueue(model.sessionResource)) {
1853 return;
1854 }
1858
1859 // Then dequeue a single non-steering request if no steering was found
1860 > const nextQueued = steeringRequests.length === 0 ? model.dequeuePendingRequest() : undefined; chatServiceImpl.ts
1861 >
1862 > const allRequests = steeringRequests.length > 0 ? steeringRequests : (nextQueued ? [nextQueued] : []);
1863 > if (allRequests.length === 0) {
1864 return;
1865 }
1888 this.info('processNextPendingRequest', `Dropping terminalExecutionId: ${terminalIds.size} conflicting terminal IDs (${[...terminalIds].join(', ')})`);
1889 }
1890 > const mergedTerminalExecutionId = terminalIds.size === 1 ? [...terminalIds][0] : undefined; chatServiceImpl.ts
1891 >
1892 > const sendOptions: IChatSendRequestOptions = {
1893 > ...firstRequest.sendOptions,
1894 > terminalExecutionId: mergedTerminalExecutionId,
1895 > attachedContext: allRequests.flatMap(req => req.request.variableData.variables.slice()),
1896 > };
1897 >
1898 > const location = sendOptions.location ?? sendOptions.locationData?.type ?? model.initialLocation;
1899 > const defaultAgent = this.chatAgentService.getDefaultAgent(location, sendOptions.modeInfo?.kind);
1900 > if (!defaultAgent) {
1901 this.logService.warn('processNextPendingRequest', `No default agent for location ${location}`);
1902 for (const deferred of deferreds) {
1921 parsedRequest = firstRequest.request.message;
1922 }
1923 > } catch (err) { chatServiceImpl.ts
1924 this.logService.error('processNextPendingRequest: failed to parse combined chat request', err);
1925 const reason = toErrorMessage(err);
1930 }
1931
1932 > const silentAgent = sendOptions.agentIdSilent ? this.chatAgentService.getAgent(sendOptions.agentIdSilent) : undefined; chatServiceImpl.ts
1933 > const agent = silentAgent ?? parsedRequest.parts.find((r): r is ChatRequestAgentPart => r instanceof ChatRequestAgentPart)?.agent ?? defaultAgent;
1934 > const agentSlashCommandPart = parsedRequest.parts.find((r): r is ChatRequestAgentSubcommandPart => r instanceof ChatRequestAgentSubcommandPart);
1935 >
1936 > const responseState = this._sendRequestAsync(model, model.sessionResource, parsedRequest, firstRequest.request.attempt, !sendOptions.noCommandDetection, silentAgent ?? defaultAgent, location, sendOptions);
1937 >
1938 > const result: ChatSendResultSent = {
1939 > kind: 'sent',
1940 > data: {
1941 > ...responseState,
1942 > agent,
1943 > slashCommand: agentSlashCommandPart?.command,
1944 > },
1945 > };
1946 > for (const deferred of deferreds) {
1947 deferred.complete(result);
1948 }
1950
1951 private generateInitialChatTitleIfNeeded(model: ChatModel, request: IChatAgentRequest, defaultAgent: IChatAgentData, token: CancellationToken): void {