From 4307010ab104bb800659f09e4abc16d371211a47 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 20:47:09 -0700 Subject: [PATCH 1/9] fix: standardize modelName and add missing modelProvider in dev data schemas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename modelTitle to modelName across all dev data schemas for consistency - Add missing modelProvider field to chatFeedback event schema - Fixes CON-3401 and CON-3400 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- packages/config-yaml/src/schemas/data/chatFeedback/index.ts | 3 ++- packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts | 3 ++- packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts | 3 ++- packages/config-yaml/src/schemas/data/chatInteraction/index.ts | 2 +- .../config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts | 2 +- packages/config-yaml/src/schemas/data/editInteraction/index.ts | 2 +- .../config-yaml/src/schemas/data/editInteraction/v0.2.0.ts | 2 +- packages/config-yaml/src/schemas/data/editOutcome/index.ts | 2 +- packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/index.ts b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts index 095b0af82..e42468a34 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/index.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts @@ -2,7 +2,8 @@ import { z } from "zod"; import { baseDevDataAllSchema } from "../base.js"; export const chatFeedbackEventAllSchema = baseDevDataAllSchema.extend({ - modelTitle: z.string(), + modelProvider: z.string(), + modelName: z.string(), completionOptions: z.object({}), prompt: z.string(), completion: z.string(), diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts index c4acddd40..796a2f375 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts @@ -1,7 +1,8 @@ import { chatFeedbackEventAllSchema } from "./index.js"; export const chatFeedbackEventSchema_0_1_0 = chatFeedbackEventAllSchema.pick({ - modelTitle: true, + modelProvider: true, + modelName: true, completionOptions: true, prompt: true, completion: true, diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts index fe0580dc5..2ec80fb0e 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts @@ -12,7 +12,8 @@ export const chatFeedbackEventSchema_0_2_0 = chatFeedbackEventAllSchema.pick({ // other prompt: true, completion: true, - modelTitle: true, + modelProvider: true, + modelName: true, feedback: true, sessionId: true, }); diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts index 14bb36ba9..b6a68f3e3 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts @@ -3,7 +3,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), - modelTitle: z.string(), + modelName: z.string(), prompt: z.string(), completion: z.string(), sessionId: z.string(), diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts index ce0983a75..54999139a 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts @@ -13,7 +13,7 @@ export const chatInteractionEventSchema_0_2_0 = // other prompt: true, completion: true, - modelTitle: true, + modelName: true, modelProvider: true, sessionId: true, tools: true, diff --git a/packages/config-yaml/src/schemas/data/editInteraction/index.ts b/packages/config-yaml/src/schemas/data/editInteraction/index.ts index 86613d762..d20ed39aa 100644 --- a/packages/config-yaml/src/schemas/data/editInteraction/index.ts +++ b/packages/config-yaml/src/schemas/data/editInteraction/index.ts @@ -6,7 +6,7 @@ import { baseDevDataAllSchema } from "../base.js"; */ export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), - modelTitle: z.string(), + modelName: z.string(), prompt: z.string(), completion: z.string(), filepath: z.string(), diff --git a/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts index ef0b0c952..b96c9c0a1 100644 --- a/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts @@ -13,7 +13,7 @@ export const editInteractionEventSchema_0_2_0 = // other prompt: true, completion: true, - modelTitle: true, + modelName: true, modelProvider: true, filepath: true, }); diff --git a/packages/config-yaml/src/schemas/data/editOutcome/index.ts b/packages/config-yaml/src/schemas/data/editOutcome/index.ts index 32c34632c..15a8cab35 100644 --- a/packages/config-yaml/src/schemas/data/editOutcome/index.ts +++ b/packages/config-yaml/src/schemas/data/editOutcome/index.ts @@ -3,7 +3,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const editOutcomeEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), - modelTitle: z.string(), + modelName: z.string(), prompt: z.string(), completion: z.string(), previousCode: z.string(), diff --git a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts index acd3be4bd..2050b3482 100644 --- a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts @@ -12,7 +12,7 @@ export const editOutcomeEventSchema_0_2_0 = editOutcomeEventAllSchema.pick({ // other prompt: true, completion: true, - modelTitle: true, + modelName: true, modelProvider: true, accepted: true, previousCode: true, From 217aa2d265322b0428fabed17eec84d09369d77b Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 20:50:15 -0700 Subject: [PATCH 2/9] fix: add missing modelProvider and modelName to nextEditWithHistory event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds missing modelProvider and modelName fields to make the schema consistent with other dev data events. Fixes CON-3402 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../config-yaml/src/schemas/data/nextEditWithHistory/index.ts | 2 ++ .../config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts b/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts index 16f4a1746..b74f873f5 100644 --- a/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts +++ b/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts @@ -15,4 +15,6 @@ export const nextEditEventAllSchema = baseDevDataAllSchema.extend({ beforeCursorPos: z.object({ line: z.number(), character: z.number() }), afterCursorPos: z.object({ line: z.number(), character: z.number() }), context: z.string(), + modelProvider: z.string(), + modelName: z.string(), }); diff --git a/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts b/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts index ec2e6bb80..4267abd88 100644 --- a/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts @@ -18,6 +18,8 @@ export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({ beforeCursorPos: true, afterCursorPos: true, context: true, + modelProvider: true, + modelName: true, }); export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({ From b8e4e95487e2472b89227546af1a7a893722ae06 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 21:00:51 -0700 Subject: [PATCH 3/9] fix: resolve TypeScript errors after dev data schema changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update test data to use modelName instead of modelTitle in log.vitest.ts - Add missing modelProvider and modelName to nextEditWithHistory event logging Resolves CI failures from schema standardization changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- core/data/log.vitest.ts | 2 +- core/nextEdit/context/processNextEditData.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/data/log.vitest.ts b/core/data/log.vitest.ts index f79e05130..44af63358 100644 --- a/core/data/log.vitest.ts +++ b/core/data/log.vitest.ts @@ -34,7 +34,7 @@ const TEST_AGENT_INTERACTION_EVENT: DevDataLogEvent = { prompt: "Hello, world!", completion: "Hello, world!", modelProvider: "openai", - modelTitle: "gpt-4", + modelName: "gpt-4", sessionId: "1234", tools: ["test-tool1"], }, diff --git a/core/nextEdit/context/processNextEditData.ts b/core/nextEdit/context/processNextEditData.ts index 0cecfe33e..1c3245669 100644 --- a/core/nextEdit/context/processNextEditData.ts +++ b/core/nextEdit/context/processNextEditData.ts @@ -61,6 +61,7 @@ export const processNextEditData = async ({ // undefined; const modelName = "Codestral"; + const modelProvider = "mistral"; const maxPromptTokens = randomNumberBetween(500, 12000); const autocompleteContext = await getAutocompleteContext( @@ -124,6 +125,8 @@ export const processNextEditData = async ({ beforeCursorPos: cursorPosBeforeEdit, afterCursorPos: cursorPosAfterPrevEdit, context: autocompleteContext, + modelProvider, + modelName, }, }); } From ca3c8f288ce25916a8faf534e96c4f7568e34725 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 21:13:26 -0700 Subject: [PATCH 4/9] fix: resolve GUI TypeScript errors after dev data schema changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update FeedbackButtons to transform modelTitle to modelName and add modelProvider - Update streamNormalInput to use modelName instead of modelTitle - Update editOutcomeLogger to use modelName throughout function signatures and return values All dev data logs now consistently use modelName as required by CON-3401. Resolves remaining CI failures from schema standardization changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- gui/src/components/FeedbackButtons.tsx | 5 ++++- gui/src/redux/thunks/streamNormalInput.ts | 2 +- gui/src/util/editOutcomeLogger.ts | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gui/src/components/FeedbackButtons.tsx b/gui/src/components/FeedbackButtons.tsx index 009666859..4d1284d9a 100644 --- a/gui/src/components/FeedbackButtons.tsx +++ b/gui/src/components/FeedbackButtons.tsx @@ -21,10 +21,13 @@ export function FeedbackButtons({ item }: FeedbackButtonsProps) { setFeedback(feedback); if (item.promptLogs?.length) { for (const promptLog of item.promptLogs) { + const { modelTitle, ...logData } = promptLog; ideMessenger.post("devdata/log", { name: "chatFeedback", data: { - ...promptLog, + ...logData, + modelProvider: "unknown", + modelName: modelTitle, feedback, sessionId, }, diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index e2f645858..26a02f846 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -274,7 +274,7 @@ export const streamNormalInput = createAsyncThunk< prompt: next.value.prompt, completion: next.value.completion, modelProvider: selectedChatModel.underlyingProviderName, - modelTitle: selectedChatModel.title, + modelName: selectedChatModel.title, sessionId: state.session.id, ...(!!activeTools.length && { tools: activeTools.map((tool) => tool.function.name), diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts index 3c1c75935..ef7883353 100644 --- a/gui/src/util/editOutcomeLogger.ts +++ b/gui/src/util/editOutcomeLogger.ts @@ -7,7 +7,7 @@ import { store } from "../redux/store"; */ function extractModelInfo(toolCallState: ToolCallState): { modelProvider: string; - modelTitle: string; + modelName: string; } { // Get the conversation history to find the model info const history = store.getState().session.history; @@ -28,7 +28,7 @@ function extractModelInfo(toolCallState: ToolCallState): { const modelParts = String(assistantMessage.message.model).split("::"); return { modelProvider: modelParts[0] || "unknown", - modelTitle: modelParts[1] || String(assistantMessage.message.model), + modelName: modelParts[1] || String(assistantMessage.message.model), }; } @@ -38,7 +38,7 @@ function extractModelInfo(toolCallState: ToolCallState): { return { modelProvider: chatModel?.provider || "unknown", - modelTitle: chatModel?.model || "unknown", + modelName: chatModel?.model || "unknown", }; } @@ -153,7 +153,7 @@ export function assembleEditOutcomeData( streamId: applyState.streamId, timestamp: new Date().toISOString(), modelProvider: modelInfo.modelProvider, - modelTitle: modelInfo.modelTitle, + modelName: modelInfo.modelName, prompt: promptAndCompletion.prompt, completion: promptAndCompletion.completion, previousCode: codeChanges.previousCode, From 4d328f9e390e95a8111b71260aa46b7180ff3c4e Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 21:21:45 -0700 Subject: [PATCH 5/9] Update streamResponse.test.ts --- gui/src/redux/thunks/streamResponse.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/redux/thunks/streamResponse.test.ts b/gui/src/redux/thunks/streamResponse.test.ts index 401c12e7d..f0c29c835 100644 --- a/gui/src/redux/thunks/streamResponse.test.ts +++ b/gui/src/redux/thunks/streamResponse.test.ts @@ -461,7 +461,7 @@ describe("streamResponseThunk", () => { prompt: "Hello", completion: "Hi there!", modelProvider: "anthropic", - modelTitle: "Claude 3.5 Sonnet", + modelName: "Claude 3.5 Sonnet", sessionId: "session-123", }, }); From 1d9a711b4cb6c5bd952809655504e767dc48bdd9 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 12 Aug 2025 21:26:08 -0700 Subject: [PATCH 6/9] fix: standardize modelTitle to modelName in VS Code extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complete the dev data schema standardization by fixing remaining references to modelTitle in the VS Code extension: - VsCodeMessenger.ts: Update editInteraction logging to use modelName - vertical/manager.ts: Update edit tracking to use modelName - EditOutcomeTracker.ts: Update interface and logging to use modelName - QuickEditQuickPick.ts: Fix misleading variable name for consistency All dev data schemas now consistently use modelName instead of modelTitle across the entire codebase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- extensions/vscode/src/diff/vertical/manager.ts | 2 +- extensions/vscode/src/extension/EditOutcomeTracker.ts | 4 ++-- extensions/vscode/src/extension/VsCodeMessenger.ts | 2 +- extensions/vscode/src/quickEdit/QuickEditQuickPick.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/vscode/src/diff/vertical/manager.ts b/extensions/vscode/src/diff/vertical/manager.ts index efa4725da..7d832b596 100644 --- a/extensions/vscode/src/diff/vertical/manager.ts +++ b/extensions/vscode/src/diff/vertical/manager.ts @@ -536,7 +536,7 @@ export class VerticalDiffManager { streamId: EDIT_MODE_STREAM_ID, timestamp: new Date().toISOString(), modelProvider: model.underlyingProviderName, - modelTitle: model.title ?? "", + modelName: model.title ?? "", prompt: stripImages(prompt), completion: newCode, previousCode, diff --git a/extensions/vscode/src/extension/EditOutcomeTracker.ts b/extensions/vscode/src/extension/EditOutcomeTracker.ts index 69ac452fa..1b793d73b 100644 --- a/extensions/vscode/src/extension/EditOutcomeTracker.ts +++ b/extensions/vscode/src/extension/EditOutcomeTracker.ts @@ -6,7 +6,7 @@ export interface PendingEditData { streamId: string; timestamp: string; modelProvider: string; - modelTitle: string; + modelName: string; prompt: string; completion: string; previousCode: string; @@ -56,7 +56,7 @@ class EditOutcomeTracker { name: "editOutcome", data: { modelProvider: pendingEdit.modelProvider, - modelTitle: pendingEdit.modelTitle, + modelName: pendingEdit.modelName, prompt: pendingEdit.prompt, completion: pendingEdit.completion, previousCode: pendingEdit.previousCode, diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index 2ecd1c205..488b1f55a 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -240,7 +240,7 @@ export class VsCodeMessenger { prompt: stripImages(prompt), completion: fileAfterEdit ?? "", modelProvider: model.underlyingProviderName, - modelTitle: model.title ?? "", + modelName: model.title ?? "", filepath: msg.data.range.filepath, }, }); diff --git a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts index 30af51cd1..c3a02beb7 100644 --- a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +++ b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts @@ -352,9 +352,9 @@ export class QuickEdit { label: QuickEditInitialItemLabels | undefined; value: string | undefined; }> { - const modelTitle = await this.getCurModel(); + const model = await this.getCurModel(); - if (!modelTitle) { + if (!model) { this.ide.showToast("error", "Please configure a model to use Quick Edit"); return { label: undefined, value: undefined }; } From ee5adeba51ff416ec0dead2ffc973e6bc1bc1643 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 13 Aug 2025 21:06:26 -0700 Subject: [PATCH 7/9] Update editOutcomeLogger.ts --- gui/src/util/editOutcomeLogger.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts index ef7883353..531bb5da3 100644 --- a/gui/src/util/editOutcomeLogger.ts +++ b/gui/src/util/editOutcomeLogger.ts @@ -154,6 +154,7 @@ export function assembleEditOutcomeData( timestamp: new Date().toISOString(), modelProvider: modelInfo.modelProvider, modelName: modelInfo.modelName, + modelTitle: modelInfo.modelName, prompt: promptAndCompletion.prompt, completion: promptAndCompletion.completion, previousCode: codeChanges.previousCode, From 3253c1182128f662858c5310db7301d9ffad7905 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 13 Aug 2025 22:06:01 -0700 Subject: [PATCH 8/9] add modelProvider to PromptLog --- core/config/types.ts | 1 + core/index.d.ts | 1 + core/llm/index.ts | 2 ++ core/llm/llm-pre-fetch.vitest.ts | 1 + core/llm/streamChat.ts | 1 + core/nextEdit/context/processNextEditData.ts | 1 + extensions/vscode/src/diff/vertical/manager.ts | 1 + extensions/vscode/src/extension/EditOutcomeTracker.ts | 2 ++ extensions/vscode/src/extension/VsCodeMessenger.ts | 2 ++ extensions/vscode/src/quickEdit/QuickEditQuickPick.ts | 6 +++--- gui/src/components/FeedbackButtons.tsx | 5 +++-- gui/src/redux/thunks/streamNormalInput.ts | 4 ++-- gui/src/redux/thunks/streamResponse.test.ts | 1 + gui/src/util/editOutcomeLogger.ts | 3 +++ packages/config-yaml/src/schemas/data/chatFeedback/index.ts | 1 + .../config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts | 1 - .../config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts | 1 + .../config-yaml/src/schemas/data/chatInteraction/index.ts | 1 + .../config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts | 1 + .../config-yaml/src/schemas/data/editInteraction/index.ts | 1 + .../config-yaml/src/schemas/data/editInteraction/v0.2.0.ts | 1 + packages/config-yaml/src/schemas/data/editOutcome/index.ts | 1 + packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts | 1 + .../src/schemas/data/nextEditWithHistory/index.ts | 1 + .../src/schemas/data/nextEditWithHistory/v0.2.0.ts | 1 + 25 files changed, 34 insertions(+), 8 deletions(-) diff --git a/core/config/types.ts b/core/config/types.ts index b9be2b209..6048cf4d3 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -387,6 +387,7 @@ declare global { export interface PromptLog { modelTitle: string; + modelProvider: string; completionOptions: CompletionOptions; prompt: string; completion: string; diff --git a/core/index.d.ts b/core/index.d.ts index f26b72b58..0962c212b 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -455,6 +455,7 @@ export type FileSymbolMap = Record; export interface PromptLog { modelTitle: string; + modelProvider: string; completionOptions: CompletionOptions; prompt: string; completion: string; diff --git a/core/llm/index.ts b/core/llm/index.ts index f280eedd4..a8c4fafc6 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -779,6 +779,7 @@ export abstract class BaseLLM implements ILLM { return { modelTitle: this.title ?? completionOptions.model, + modelProvider: this.underlyingProviderName, prompt, completion, completionOptions, @@ -1094,6 +1095,7 @@ export abstract class BaseLLM implements ILLM { return { modelTitle: this.title ?? completionOptions.model, + modelProvider: this.underlyingProviderName, prompt, completion, completionOptions, diff --git a/core/llm/llm-pre-fetch.vitest.ts b/core/llm/llm-pre-fetch.vitest.ts index 3db39fc3e..3ba86ffa1 100644 --- a/core/llm/llm-pre-fetch.vitest.ts +++ b/core/llm/llm-pre-fetch.vitest.ts @@ -23,6 +23,7 @@ async function dudLLMCall(llm: ILLM, messages: ChatMessage[]) { model: "", }, modelTitle: "", + modelProvider: "", prompt: "", }); abortController.abort(); diff --git a/core/llm/streamChat.ts b/core/llm/streamChat.ts index 2692195e2..fd26b96f0 100644 --- a/core/llm/streamChat.ts +++ b/core/llm/streamChat.ts @@ -40,6 +40,7 @@ export async function* llmStreamChat( // Log to return in case of error const errorPromptLog = { modelTitle: model?.title ?? model?.model, + modelProvider: model?.underlyingProviderName ?? "unknown", completion: "", prompt: "", completionOptions: { diff --git a/core/nextEdit/context/processNextEditData.ts b/core/nextEdit/context/processNextEditData.ts index 1c3245669..2aa4adb79 100644 --- a/core/nextEdit/context/processNextEditData.ts +++ b/core/nextEdit/context/processNextEditData.ts @@ -127,6 +127,7 @@ export const processNextEditData = async ({ context: autocompleteContext, modelProvider, modelName, + modelTitle: modelName, }, }); } diff --git a/extensions/vscode/src/diff/vertical/manager.ts b/extensions/vscode/src/diff/vertical/manager.ts index 7d832b596..e30f898c0 100644 --- a/extensions/vscode/src/diff/vertical/manager.ts +++ b/extensions/vscode/src/diff/vertical/manager.ts @@ -537,6 +537,7 @@ export class VerticalDiffManager { timestamp: new Date().toISOString(), modelProvider: model.underlyingProviderName, modelName: model.title ?? "", + modelTitle: model.title ?? "", prompt: stripImages(prompt), completion: newCode, previousCode, diff --git a/extensions/vscode/src/extension/EditOutcomeTracker.ts b/extensions/vscode/src/extension/EditOutcomeTracker.ts index 1b793d73b..ab691ae7a 100644 --- a/extensions/vscode/src/extension/EditOutcomeTracker.ts +++ b/extensions/vscode/src/extension/EditOutcomeTracker.ts @@ -7,6 +7,7 @@ export interface PendingEditData { timestamp: string; modelProvider: string; modelName: string; + modelTitle: string; prompt: string; completion: string; previousCode: string; @@ -57,6 +58,7 @@ class EditOutcomeTracker { data: { modelProvider: pendingEdit.modelProvider, modelName: pendingEdit.modelName, + modelTitle: pendingEdit.modelName, prompt: pendingEdit.prompt, completion: pendingEdit.completion, previousCode: pendingEdit.previousCode, diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index 488b1f55a..516e47983 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -30,6 +30,7 @@ import { showTutorial } from "../util/tutorial"; import { getExtensionUri } from "../util/vscode"; import { VsCodeIde } from "../VsCodeIde"; import { VsCodeWebviewProtocol } from "../webviewProtocol"; + import { VsCodeExtension } from "./VsCodeExtension"; type ToIdeOrWebviewFromCoreProtocol = ToIdeFromCoreProtocol & @@ -241,6 +242,7 @@ export class VsCodeMessenger { completion: fileAfterEdit ?? "", modelProvider: model.underlyingProviderName, modelName: model.title ?? "", + modelTitle: model.title ?? "", filepath: msg.data.range.filepath, }, }); diff --git a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts index c3a02beb7..af3b3f882 100644 --- a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +++ b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts @@ -238,15 +238,15 @@ export class QuickEdit { prompt: string, path: string | undefined, ) => { - const model = await this.getCurModel(); - if (!model) { + const modelTitle = await this.getCurModel(); + if (!modelTitle) { throw new Error("No model selected"); } const { config } = await this.configHandler.loadConfig(); const rules = config?.rules ?? []; // no need to error - getCurModel above will handle - await this._streamEditWithInputAndContext(prompt, model, rules); + await this._streamEditWithInputAndContext(prompt, modelTitle, rules); this.openAcceptRejectMenu(prompt, path); }; diff --git a/gui/src/components/FeedbackButtons.tsx b/gui/src/components/FeedbackButtons.tsx index 4d1284d9a..f03c02f2c 100644 --- a/gui/src/components/FeedbackButtons.tsx +++ b/gui/src/components/FeedbackButtons.tsx @@ -21,13 +21,14 @@ export function FeedbackButtons({ item }: FeedbackButtonsProps) { setFeedback(feedback); if (item.promptLogs?.length) { for (const promptLog of item.promptLogs) { - const { modelTitle, ...logData } = promptLog; + const { modelTitle, modelProvider, ...logData } = promptLog; ideMessenger.post("devdata/log", { name: "chatFeedback", data: { ...logData, - modelProvider: "unknown", + modelProvider: modelProvider || "unknown", modelName: modelTitle, + modelTitle: modelTitle, feedback, sessionId, }, diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 26a02f846..543f3273f 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -3,7 +3,6 @@ import { LLMFullCompletionOptions, ModelDescription, Tool } from "core"; import { getRuleId } from "core/llm/rules/getSystemMessageWithRules"; import { ToCoreProtocol } from "core/protocol"; import { BuiltInToolNames } from "core/tools/builtIn"; -import posthog from "posthog-js"; import { selectActiveTools } from "../selectors/selectActiveTools"; import { selectUseSystemMessageTools } from "../selectors/selectUseSystemMessageTools"; import { selectSelectedChatModel } from "../slices/configSlice"; @@ -27,9 +26,9 @@ import { addSystemMessageToolsToSystemMessage } from "core/tools/systemMessageTo import { interceptSystemToolCalls } from "core/tools/systemMessageTools/interceptSystemToolCalls"; import { SystemMessageToolCodeblocksFramework } from "core/tools/systemMessageTools/toolCodeblocks"; import { selectCurrentToolCalls } from "../selectors/selectToolCalls"; +import { DEFAULT_TOOL_SETTING } from "../slices/uiSlice"; import { getBaseSystemMessage } from "../util/getBaseSystemMessage"; import { callToolById } from "./callToolById"; -import { DEFAULT_TOOL_SETTING } from "../slices/uiSlice"; /** * Handles the execution of tool calls that may be automatically accepted. * Sets all tools as generated first, then executes auto-approved tool calls. @@ -275,6 +274,7 @@ export const streamNormalInput = createAsyncThunk< completion: next.value.completion, modelProvider: selectedChatModel.underlyingProviderName, modelName: selectedChatModel.title, + modelTitle: selectedChatModel.title, sessionId: state.session.id, ...(!!activeTools.length && { tools: activeTools.map((tool) => tool.function.name), diff --git a/gui/src/redux/thunks/streamResponse.test.ts b/gui/src/redux/thunks/streamResponse.test.ts index f0c29c835..db4613b08 100644 --- a/gui/src/redux/thunks/streamResponse.test.ts +++ b/gui/src/redux/thunks/streamResponse.test.ts @@ -462,6 +462,7 @@ describe("streamResponseThunk", () => { completion: "Hi there!", modelProvider: "anthropic", modelName: "Claude 3.5 Sonnet", + modelTitle: "Claude 3.5 Sonnet", sessionId: "session-123", }, }); diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts index 531bb5da3..124f11ed3 100644 --- a/gui/src/util/editOutcomeLogger.ts +++ b/gui/src/util/editOutcomeLogger.ts @@ -8,6 +8,7 @@ import { store } from "../redux/store"; function extractModelInfo(toolCallState: ToolCallState): { modelProvider: string; modelName: string; + modelTitle: string; } { // Get the conversation history to find the model info const history = store.getState().session.history; @@ -29,6 +30,7 @@ function extractModelInfo(toolCallState: ToolCallState): { return { modelProvider: modelParts[0] || "unknown", modelName: modelParts[1] || String(assistantMessage.message.model), + modelTitle: modelParts[1] || String(assistantMessage.message.model), }; } @@ -39,6 +41,7 @@ function extractModelInfo(toolCallState: ToolCallState): { return { modelProvider: chatModel?.provider || "unknown", modelName: chatModel?.model || "unknown", + modelTitle: chatModel?.model || "unknown", }; } diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/index.ts b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts index e42468a34..d68648fe7 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/index.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/index.ts @@ -4,6 +4,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const chatFeedbackEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), modelName: z.string(), + modelTitle: z.string(), completionOptions: z.object({}), prompt: z.string(), completion: z.string(), diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts index 796a2f375..f3ea4408e 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts @@ -1,7 +1,6 @@ import { chatFeedbackEventAllSchema } from "./index.js"; export const chatFeedbackEventSchema_0_1_0 = chatFeedbackEventAllSchema.pick({ - modelProvider: true, modelName: true, completionOptions: true, prompt: true, diff --git a/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts index 2ec80fb0e..3b71754d6 100644 --- a/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts @@ -14,6 +14,7 @@ export const chatFeedbackEventSchema_0_2_0 = chatFeedbackEventAllSchema.pick({ completion: true, modelProvider: true, modelName: true, + modelTitle: true, feedback: true, sessionId: true, }); diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts index b6a68f3e3..8b4208a0a 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts @@ -4,6 +4,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), modelName: z.string(), + modelTitle: z.string(), prompt: z.string(), completion: z.string(), sessionId: z.string(), diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts index 54999139a..dd7ef4bda 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts @@ -14,6 +14,7 @@ export const chatInteractionEventSchema_0_2_0 = prompt: true, completion: true, modelName: true, + modelTitle: true, modelProvider: true, sessionId: true, tools: true, diff --git a/packages/config-yaml/src/schemas/data/editInteraction/index.ts b/packages/config-yaml/src/schemas/data/editInteraction/index.ts index d20ed39aa..ce0f875a2 100644 --- a/packages/config-yaml/src/schemas/data/editInteraction/index.ts +++ b/packages/config-yaml/src/schemas/data/editInteraction/index.ts @@ -7,6 +7,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), modelName: z.string(), + modelTitle: z.string(), prompt: z.string(), completion: z.string(), filepath: z.string(), diff --git a/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts index b96c9c0a1..7ef121b68 100644 --- a/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts @@ -14,6 +14,7 @@ export const editInteractionEventSchema_0_2_0 = prompt: true, completion: true, modelName: true, + modelTitle: true, modelProvider: true, filepath: true, }); diff --git a/packages/config-yaml/src/schemas/data/editOutcome/index.ts b/packages/config-yaml/src/schemas/data/editOutcome/index.ts index 15a8cab35..096e6cdb3 100644 --- a/packages/config-yaml/src/schemas/data/editOutcome/index.ts +++ b/packages/config-yaml/src/schemas/data/editOutcome/index.ts @@ -4,6 +4,7 @@ import { baseDevDataAllSchema } from "../base.js"; export const editOutcomeEventAllSchema = baseDevDataAllSchema.extend({ modelProvider: z.string(), modelName: z.string(), + modelTitle: z.string(), prompt: z.string(), completion: z.string(), previousCode: z.string(), diff --git a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts index 2050b3482..c2c283a9c 100644 --- a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts @@ -13,6 +13,7 @@ export const editOutcomeEventSchema_0_2_0 = editOutcomeEventAllSchema.pick({ prompt: true, completion: true, modelName: true, + modelTitle: true, modelProvider: true, accepted: true, previousCode: true, diff --git a/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts b/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts index b74f873f5..11f23011b 100644 --- a/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts +++ b/packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts @@ -17,4 +17,5 @@ export const nextEditEventAllSchema = baseDevDataAllSchema.extend({ context: z.string(), modelProvider: z.string(), modelName: z.string(), + modelTitle: z.string(), }); diff --git a/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts b/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts index 4267abd88..70c3546ca 100644 --- a/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts @@ -20,6 +20,7 @@ export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({ context: true, modelProvider: true, modelName: true, + modelTitle: true, }); export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({ From 9a2b36ff6e3b87406d08483d739be13b6266b317 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 13 Aug 2025 22:12:33 -0700 Subject: [PATCH 9/9] fix types --- core/data/log.vitest.ts | 1 + core/edit/recursiveStream.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/core/data/log.vitest.ts b/core/data/log.vitest.ts index 44af63358..25defe504 100644 --- a/core/data/log.vitest.ts +++ b/core/data/log.vitest.ts @@ -35,6 +35,7 @@ const TEST_AGENT_INTERACTION_EVENT: DevDataLogEvent = { completion: "Hello, world!", modelProvider: "openai", modelName: "gpt-4", + modelTitle: "gpt-4", sessionId: "1234", tools: ["test-tool1"], }, diff --git a/core/edit/recursiveStream.ts b/core/edit/recursiveStream.ts index d249755f4..35678c892 100644 --- a/core/edit/recursiveStream.ts +++ b/core/edit/recursiveStream.ts @@ -7,6 +7,7 @@ const INFINITE_STREAM_SAFETY = 0.9; const DUD_PROMPT_LOG: PromptLog = { modelTitle: "", + modelProvider: "", completionOptions: { model: "" }, prompt: "", completion: "",