Changesets · Branches · Tags · Compare
| Changeset | 04e94bf722396d44cfef8ac2c8ef88ce1a48b1e3afb2125e371b6f5ab3a250c3 |
|---|---|
| Author | Adarsh Iyer <76015889+adarshramiyer@users.noreply.github.com> · 2025-06-26 13:16 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-06-26 13:16 -07:00 |
| Parents | a1d9b27669b0, b9e984bd3e96 |
4 files changed
modified gui/src/redux/slices/sessionSlice.ts +0 −23
| @@ -18,9 +18,7 @@ | ||
| 18 | 18 | RuleWithSource, |
| 19 | 19 | Session, |
| 20 | 20 | SessionMetadata, |
| 21 | - ToolCallState, | |
| 22 | 21 | } from "core"; |
| 23 | -import { safeParseToolCallArgs } from "core/tools/parseArgs"; | |
| 24 | 22 | import { NEW_SESSION_TITLE } from "core/util/constants"; |
| 25 | 23 | import { renderChatMessage } from "core/util/messageContent"; |
| 26 | 24 | import { findUriInDirs, getUriPathBasename } from "core/util/uri"; |
| @@ -30,25 +28,6 @@ | ||
| 30 | 28 | import { streamResponseThunk } from "../thunks/streamResponse"; |
| 31 | 29 | import { findCurrentToolCall, findToolCall } from "../util"; |
| 32 | 30 | |
| 33 | -const getIdeMessenger = () => (window as any).ideMessenger; | |
| 34 | - | |
| 35 | -const logToolUsage = (toolCallState: ToolCallState, success: boolean) => { | |
| 36 | - const ideMessenger = getIdeMessenger(); | |
| 37 | - if (ideMessenger) { | |
| 38 | - ideMessenger.post("devdata/log", { | |
| 39 | - name: "toolUsage", | |
| 40 | - data: { | |
| 41 | - toolCallId: toolCallState.toolCallId, | |
| 42 | - functionName: toolCallState.toolCall.function.name, | |
| 43 | - functionArgs: toolCallState.toolCall.function.arguments, | |
| 44 | - parsedArgs: safeParseToolCallArgs(toolCallState.toolCall), | |
| 45 | - succeeded: success, | |
| 46 | - output: toolCallState.output || [], | |
| 47 | - }, | |
| 48 | - }); | |
| 49 | - } | |
| 50 | -}; | |
| 51 | - | |
| 52 | 31 | // We need this to handle reorderings (e.g. a mid-array deletion) of the messages array. |
| 53 | 32 | // The proper fix is adding a UUID to all chat messages, but this is the temp workaround. |
| 54 | 33 | export type ChatHistoryItemWithMessageId = ChatHistoryItem & { |
| @@ -580,7 +559,6 @@ | ||
| 580 | 559 | ); |
| 581 | 560 | if (toolCallState) { |
| 582 | 561 | toolCallState.status = "errored"; |
| 583 | - logToolUsage(toolCallState, false); | |
| 584 | 562 | } |
| 585 | 563 | }, |
| 586 | 564 | acceptToolCall: ( |
| @@ -595,7 +573,6 @@ | ||
| 595 | 573 | ); |
| 596 | 574 | if (toolCallState) { |
| 597 | 575 | toolCallState.status = "done"; |
| 598 | - logToolUsage(toolCallState, true); | |
| 599 | 576 | } |
| 600 | 577 | }, |
| 601 | 578 | setToolCallCalling: ( |
modified packages/config-yaml/src/schemas/data/index.ts +0 −8
| @@ -42,11 +42,6 @@ | ||
| 42 | 42 | tokensGeneratedEventSchema_0_2_0, |
| 43 | 43 | tokensGeneratedEventSchema_0_2_0_noCode, |
| 44 | 44 | } from "./tokensGenerated/v0.2.0.js"; |
| 45 | -import { toolUsageEventAllSchema } from "./toolUsage/index.js"; | |
| 46 | -import { | |
| 47 | - toolUsageEventSchema_0_2_0, | |
| 48 | - toolUsageEventSchema_0_2_0_noCode, | |
| 49 | -} from "./toolUsage/v0.2.0.js"; | |
| 50 | 45 | |
| 51 | 46 | const semverRegex = |
| 52 | 47 | /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/; |
| @@ -77,7 +72,6 @@ | ||
| 77 | 72 | tokensGenerated: tokensGeneratedEventAllSchema, |
| 78 | 73 | chatInteraction: chatInteractionEventAllSchema, |
| 79 | 74 | editInteraction: editInteractionEventAllSchema, |
| 80 | - toolUsage: toolUsageEventAllSchema, | |
| 81 | 75 | }); |
| 82 | 76 | |
| 83 | 77 | // Version and level specific schemas are organized here |
| @@ -103,7 +97,6 @@ | ||
| 103 | 97 | tokensGenerated: tokensGeneratedEventSchema_0_2_0, |
| 104 | 98 | chatInteraction: chatInteractionEventSchema_0_2_0, |
| 105 | 99 | editInteraction: editInteractionEventSchema_0_2_0, |
| 106 | - toolUsage: toolUsageEventSchema_0_2_0, | |
| 107 | 100 | }, |
| 108 | 101 | noCode: { |
| 109 | 102 | autocomplete: autocompleteEventSchema_0_2_0_noCode, |
| @@ -111,7 +104,6 @@ | ||
| 111 | 104 | tokensGenerated: tokensGeneratedEventSchema_0_2_0_noCode, |
| 112 | 105 | chatInteraction: chatInteractionEventSchema_0_2_0_noCode, |
| 113 | 106 | editInteraction: editInteractionEventSchema_0_2_0_noCode, |
| 114 | - toolUsage: toolUsageEventSchema_0_2_0_noCode, | |
| 115 | 107 | }, |
| 116 | 108 | }, |
| 117 | 109 | }; |
deleted packages/config-yaml/src/schemas/data/toolUsage/index.ts +0 −11
| @@ -1,11 +0,0 @@ | ||
| 1 | -import { z } from "zod"; | |
| 2 | -import { baseDevDataAllSchema } from "../base.js"; | |
| 3 | - | |
| 4 | -export const toolUsageEventAllSchema = baseDevDataAllSchema.extend({ | |
| 5 | - toolCallId: z.string(), | |
| 6 | - functionName: z.string(), | |
| 7 | - functionArgs: z.string(), | |
| 8 | - parsedArgs: z.any(), | |
| 9 | - succeeded: z.boolean(), | |
| 10 | - output: z.array(z.any()).optional(), | |
| 11 | -}); |
deleted packages/config-yaml/src/schemas/data/toolUsage/v0.2.0.ts +0 −26
| @@ -1,26 +0,0 @@ | ||
| 1 | -import { toolUsageEventAllSchema } from "./index.js"; | |
| 2 | - | |
| 3 | -export const toolUsageEventSchema_0_2_0 = toolUsageEventAllSchema.pick({ | |
| 4 | - // base | |
| 5 | - timestamp: true, | |
| 6 | - userId: true, | |
| 7 | - userAgent: true, | |
| 8 | - selectedProfileId: true, | |
| 9 | - eventName: true, | |
| 10 | - schema: true, | |
| 11 | - | |
| 12 | - // tool-usage-specific | |
| 13 | - toolCallId: true, | |
| 14 | - functionName: true, | |
| 15 | - functionArgs: true, | |
| 16 | - parsedArgs: true, | |
| 17 | - succeeded: true, | |
| 18 | - output: true, | |
| 19 | -}); | |
| 20 | - | |
| 21 | -export const toolUsageEventSchema_0_2_0_noCode = | |
| 22 | - toolUsageEventSchema_0_2_0.omit({ | |
| 23 | - functionArgs: true, | |
| 24 | - parsedArgs: true, | |
| 25 | - output: true, | |
| 26 | - }); |