chatServiceImpl.ts ×8

Frontier kind: Code frontier

unlabeled · c_bd765f4fa72f

16 tests · 71590 LOC · 309 files · introduces 0 tests · 48 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges48 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
6055 ranges71590 lines · 309 files · Browse complete extent
All tests (intent)
16 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: 48 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 47 introduced LOC · 8 ranges

Open complete file

803 const requestParser = isAgentHostSession ? this.instantiationService.createInstance(ChatRequestParser) : undefined;
804 const parseAgentHostHistoryPrompt = (text: string, agent: IChatAgentData | undefined): IParsedChatRequest => {
805 > if (requestParser) { chatServiceImpl.ts
806 > try {
807 > const attachmentCapabilities = this.getAttachmentCapabilitiesForParser(chatSessionType, agent);
808 > const parsed = requestParser.parseChatRequestWithReferences(
809 > EMPTY_REFERENCES,
810 > EMPTY_TOOL_ENABLEMENT_MAP,
811 > text,
812 > location,
813 > { sessionType: chatSessionType, forcedAgent: agent, attachmentCapabilities },
814 > );
815 > if (parsed.parts.length > 0) {
816 > return parsed;
817 > }
818 > } catch (e) {
819 this.logService.warn(`ChatService#loadRemoteSession: failed to re-parse historical prompt for ${chatSessionType}`, e);
820 }
822 return {
823 text,
828 )]
829 };
831
832 let lastRequest: ChatRequestModel | undefined;
841 };
842 for (const message of providedSession.history) {
843 > if (message.type === 'request') { chatServiceImpl.ts
844 > if (lastRequest) {
845 completeLastResponse();
846 }
848 > const requestText = message.prompt;
849 > const agent =
850 > message.participant
851 > ? this.chatAgentService.getAgent(message.participant) // TODO(jospicer): Remove and always hardcode?
852 : this.chatAgentService.getAgent(chatSessionType);
853 > const parsedRequest = parseAgentHostHistoryPrompt(requestText, agent); chatServiceImpl.ts
854 > const modeInfo = message.modeInstructions ? {
855 kind: ChatModeKind.Agent,
856 isBuiltin: message.modeInstructions.isBuiltin ?? false,
858 telemetryModeId: 'custom',
859 applyCodeBlockSuggestionId: undefined,
860 > } satisfies IChatRequestModeInfo : undefined; chatServiceImpl.ts
861 > lastRequest = model.addRequest(parsedRequest,
862 > message.variableData ?? { variables: [] },
863 > 0, // attempt
864 > modeInfo,
865 > agent,
866 > undefined, // slashCommand
867 > undefined, // confirmation
868 > undefined, // locationData
869 > undefined, // attachments
870 > false, // Do not treat as requests completed, else edit pills won't show.
871 > message.modelId,
872 > undefined,
873 > message.id,
874 > message.isSystemInitiated,
875 > message.systemInitiatedLabel,
876 > undefined, // terminalExecutionId
877 > message.isTerminalRequest,
878 > message.timestamp ?? null,
879 > );
880 > } else {
881 // response
882 if (lastRequest) {
896 }
897 }
899
900 // Set up progress streaming and cancellation for contributed sessions.
src/vs/workbench/contrib/chat/common/model/chatModel.ts 1 introduced LOC · 1 range

Open complete file

2952 const requestTimestamp = timestamp === undefined
2953 ? Date.now()
2954 > : typeof timestamp === 'number' && Number.isFinite(timestamp) && timestamp > 0 chatModel.ts
2955 ? timestamp
2956 : undefined;