chatToolInvocation.ts ×5

Frontier kind: Joint frontier

unlabeled · c_6785f61493e5

1 test · 45856 LOC · 194 files · introduces 1 test · 25 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges25 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4447 ranges45856 lines · 194 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

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

src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.ts 21 introduced LOC · 5 ranges

Open complete file

67 */
68 public static createStreaming(options: IStreamingToolCallOptions): ChatToolInvocation {
69 > return new ChatToolInvocation(undefined, options.toolData, options.toolCallId, options.subagentInvocationId, undefined, { startInStreaming: true }, options.chatRequestId); chatToolInvocation.ts
70 > }
71
72 /**
90 let defaultMessage: string | IMarkdownString = '';
91 if (startOptions.startInStreaming) {
92 > defaultMessage = toolData.displayName; chatToolInvocation.ts
93 } else if (startOptions.startInCancelled) {
94 defaultMessage = startOptions.cancelReasonMessage ?? localize('toolDeniedMessage', "Tool \"{0}\" was denied", toolData.displayName);
117 });
118 } else if (startOptions.startInStreaming) {
119 > // Start in streaming state chatToolInvocation.ts
120 > this._state = observableValue(this, {
121 > type: IChatToolInvocation.StateKind.Streaming,
122 > partialInput: this._partialInput,
123 > streamingMessage: this._streamingMessage,
124 > });
125 } else if (!this.confirmationMessages?.title) {
126 this._state = observableValue(this, {
212 */
213 public cancelFromStreaming(reason: ToolConfirmKind.Denied | ToolConfirmKind.Skipped, reasonMessage?: string | IMarkdownString): boolean {
214 > const currentState = this._state.get(); chatToolInvocation.ts
215 > if (currentState.type !== IChatToolInvocation.StateKind.Streaming) {
216 return false; // Only cancel from streaming state
217 }
219 > this._state.set({
220 > type: IChatToolInvocation.StateKind.Cancelled,
221 > reason: reason,
222 > reasonMessage: reasonMessage,
223 > parameters: this.parameters,
224 > confirmationMessages: this.confirmationMessages,
225 > }, undefined);
226 > return true;
227 > }
228
229 /**
src/vs/workbench/contrib/chat/common/model/chatModel.ts 4 introduced LOC · 2 ranges

Open complete file

1593 // spinner/"Editing files" label. See https://github.com/microsoft/vscode/issues/288701.
1594 for (const part of this._response.value) {
1595 > if (part.kind === 'toolInvocation' && part instanceof ChatToolInvocation) { chatModel.ts
1596 > part.cancelFromStreaming(ToolConfirmKind.Skipped);
1597 > } else if (part instanceof ChatPlanReviewData) {
1598 part.dismiss();
1599 } else if (part instanceof ChatQuestionCarouselData) {
1600 part.dismiss(undefined);
1601 }
1602 > } chatModel.ts
1603
1604 const completedAt = Date.now();