Elffuss BraidHub

kikocis/continue public

Merge pull request #7116 from continuedev/pe/devdata-fixed

fix: standardize dev data schemas and add missing fields
Changesetfa56c1e07ee24e4acc6c93e68530da5d9a118c3555b95532d633aa57445d1be3
AuthorDallin Romney <dallinromney@gmail.com> · 2025-08-14 13:23 -07:00
CommitterGitHub <noreply@github.com> · 2025-08-14 13:23 -07:00
Parents7afbc8ab1fe5, 8f9e08cc0c4a

Browse the files at this changeset

27 files changed

modified core/config/types.ts +1 −0
@@ -387,6 +387,7 @@
387387
388388 export interface PromptLog {
389389 modelTitle: string;
390+ modelProvider: string;
390391 completionOptions: CompletionOptions;
391392 prompt: string;
392393 completion: string;
modified core/data/log.vitest.ts +1 −0
@@ -34,6 +34,7 @@
3434 prompt: "Hello, world!",
3535 completion: "Hello, world!",
3636 modelProvider: "openai",
37+ modelName: "gpt-4",
3738 modelTitle: "gpt-4",
3839 sessionId: "1234",
3940 tools: ["test-tool1"],
modified core/edit/recursiveStream.ts +1 −0
@@ -7,6 +7,7 @@
77
88 const DUD_PROMPT_LOG: PromptLog = {
99 modelTitle: "",
10+ modelProvider: "",
1011 completionOptions: { model: "" },
1112 prompt: "",
1213 completion: "",
modified core/index.d.ts +1 −0
@@ -455,6 +455,7 @@
455455
456456 export interface PromptLog {
457457 modelTitle: string;
458+ modelProvider: string;
458459 completionOptions: CompletionOptions;
459460 prompt: string;
460461 completion: string;
modified core/llm/index.ts +2 −0
@@ -779,6 +779,7 @@
779779
780780 return {
781781 modelTitle: this.title ?? completionOptions.model,
782+ modelProvider: this.underlyingProviderName,
782783 prompt,
783784 completion,
784785 completionOptions,
@@ -1094,6 +1095,7 @@
10941095
10951096 return {
10961097 modelTitle: this.title ?? completionOptions.model,
1098+ modelProvider: this.underlyingProviderName,
10971099 prompt,
10981100 completion,
10991101 completionOptions,
modified core/llm/llm-pre-fetch.vitest.ts +1 −0
@@ -23,6 +23,7 @@
2323 model: "",
2424 },
2525 modelTitle: "",
26+ modelProvider: "",
2627 prompt: "",
2728 });
2829 abortController.abort();
modified core/llm/streamChat.ts +1 −0
@@ -40,6 +40,7 @@
4040 // Log to return in case of error
4141 const errorPromptLog = {
4242 modelTitle: model?.title ?? model?.model,
43+ modelProvider: model?.underlyingProviderName ?? "unknown",
4344 completion: "",
4445 prompt: "",
4546 completionOptions: {
modified core/nextEdit/context/processNextEditData.ts +4 −0
@@ -61,6 +61,7 @@
6161 // undefined;
6262
6363 const modelName = "Codestral";
64+ const modelProvider = "mistral";
6465 const maxPromptTokens = randomNumberBetween(500, 12000);
6566
6667 const autocompleteContext = await getAutocompleteContext(
@@ -124,6 +125,9 @@
124125 beforeCursorPos: cursorPosBeforeEdit,
125126 afterCursorPos: cursorPosAfterPrevEdit,
126127 context: autocompleteContext,
128+ modelProvider,
129+ modelName,
130+ modelTitle: modelName,
127131 },
128132 });
129133 }
modified extensions/vscode/src/diff/vertical/manager.ts +1 −0
@@ -536,6 +536,7 @@
536536 streamId: EDIT_MODE_STREAM_ID,
537537 timestamp: new Date().toISOString(),
538538 modelProvider: model.underlyingProviderName,
539+ modelName: model.title ?? "",
539540 modelTitle: model.title ?? "",
540541 prompt: stripImages(prompt),
541542 completion: newCode,
modified extensions/vscode/src/extension/EditOutcomeTracker.ts +3 −1
@@ -6,6 +6,7 @@
66 streamId: string;
77 timestamp: string;
88 modelProvider: string;
9+ modelName: string;
910 modelTitle: string;
1011 prompt: string;
1112 completion: string;
@@ -56,7 +57,8 @@
5657 name: "editOutcome",
5758 data: {
5859 modelProvider: pendingEdit.modelProvider,
59- modelTitle: pendingEdit.modelTitle,
60+ modelName: pendingEdit.modelName,
61+ modelTitle: pendingEdit.modelName,
6062 prompt: pendingEdit.prompt,
6163 completion: pendingEdit.completion,
6264 previousCode: pendingEdit.previousCode,
modified extensions/vscode/src/extension/VsCodeMessenger.ts +2 −0
@@ -30,6 +30,7 @@
3030 import { getExtensionUri } from "../util/vscode";
3131 import { VsCodeIde } from "../VsCodeIde";
3232 import { VsCodeWebviewProtocol } from "../webviewProtocol";
33+
3334 import { VsCodeExtension } from "./VsCodeExtension";
3435
3536 type ToIdeOrWebviewFromCoreProtocol = ToIdeFromCoreProtocol &
@@ -240,6 +241,7 @@
240241 prompt: stripImages(prompt),
241242 completion: fileAfterEdit ?? "",
242243 modelProvider: model.underlyingProviderName,
244+ modelName: model.title ?? "",
243245 modelTitle: model.title ?? "",
244246 filepath: msg.data.range.filepath,
245247 },
modified extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +5 −5
@@ -238,15 +238,15 @@
238238 prompt: string,
239239 path: string | undefined,
240240 ) => {
241- const model = await this.getCurModel();
242- if (!model) {
241+ const modelTitle = await this.getCurModel();
242+ if (!modelTitle) {
243243 throw new Error("No model selected");
244244 }
245245
246246 const { config } = await this.configHandler.loadConfig();
247247 const rules = config?.rules ?? []; // no need to error - getCurModel above will handle
248248
249- await this._streamEditWithInputAndContext(prompt, model, rules);
249+ await this._streamEditWithInputAndContext(prompt, modelTitle, rules);
250250 this.openAcceptRejectMenu(prompt, path);
251251 };
252252
@@ -352,9 +352,9 @@
352352 label: QuickEditInitialItemLabels | undefined;
353353 value: string | undefined;
354354 }> {
355- const modelTitle = await this.getCurModel();
355+ const model = await this.getCurModel();
356356
357- if (!modelTitle) {
357+ if (!model) {
358358 this.ide.showToast("error", "Please configure a model to use Quick Edit");
359359 return { label: undefined, value: undefined };
360360 }
modified gui/src/components/FeedbackButtons.tsx +5 −1
@@ -21,10 +21,14 @@
2121 setFeedback(feedback);
2222 if (item.promptLogs?.length) {
2323 for (const promptLog of item.promptLogs) {
24+ const { modelTitle, modelProvider, ...logData } = promptLog;
2425 ideMessenger.post("devdata/log", {
2526 name: "chatFeedback",
2627 data: {
27- ...promptLog,
28+ ...logData,
29+ modelProvider: modelProvider || "unknown",
30+ modelName: modelTitle,
31+ modelTitle: modelTitle,
2832 feedback,
2933 sessionId,
3034 },
modified gui/src/redux/thunks/streamNormalInput.ts +1 −0
@@ -273,6 +273,7 @@
273273 prompt: next.value.prompt,
274274 completion: next.value.completion,
275275 modelProvider: selectedChatModel.underlyingProviderName,
276+ modelName: selectedChatModel.title,
276277 modelTitle: selectedChatModel.title,
277278 sessionId: state.session.id,
278279 ...(!!activeTools.length && {
modified gui/src/redux/thunks/streamResponse.test.ts +1 −0
@@ -461,6 +461,7 @@
461461 prompt: "Hello",
462462 completion: "Hi there!",
463463 modelProvider: "anthropic",
464+ modelName: "Claude 3.5 Sonnet",
464465 modelTitle: "Claude 3.5 Sonnet",
465466 sessionId: "session-123",
466467 },
modified gui/src/util/editOutcomeLogger.ts +5 −1
@@ -7,6 +7,7 @@
77 */
88 function extractModelInfo(toolCallState: ToolCallState): {
99 modelProvider: string;
10+ modelName: string;
1011 modelTitle: string;
1112 } {
1213 // Get the conversation history to find the model info
@@ -28,6 +29,7 @@
2829 const modelParts = String(assistantMessage.message.model).split("::");
2930 return {
3031 modelProvider: modelParts[0] || "unknown",
32+ modelName: modelParts[1] || String(assistantMessage.message.model),
3133 modelTitle: modelParts[1] || String(assistantMessage.message.model),
3234 };
3335 }
@@ -38,6 +40,7 @@
3840
3941 return {
4042 modelProvider: chatModel?.provider || "unknown",
43+ modelName: chatModel?.model || "unknown",
4144 modelTitle: chatModel?.model || "unknown",
4245 };
4346 }
@@ -153,7 +156,8 @@
153156 streamId: applyState.streamId,
154157 timestamp: new Date().toISOString(),
155158 modelProvider: modelInfo.modelProvider,
156- modelTitle: modelInfo.modelTitle,
159+ modelName: modelInfo.modelName,
160+ modelTitle: modelInfo.modelName,
157161 prompt: promptAndCompletion.prompt,
158162 completion: promptAndCompletion.completion,
159163 previousCode: codeChanges.previousCode,
modified packages/config-yaml/src/schemas/data/chatFeedback/index.ts +2 −0
@@ -2,6 +2,8 @@
22 import { baseDevDataAllSchema } from "../base.js";
33
44 export const chatFeedbackEventAllSchema = baseDevDataAllSchema.extend({
5+ modelProvider: z.string(),
6+ modelName: z.string(),
57 modelTitle: z.string(),
68 completionOptions: z.object({}),
79 prompt: z.string(),
modified packages/config-yaml/src/schemas/data/chatFeedback/v0.1.0.ts +1 −1
@@ -1,7 +1,7 @@
11 import { chatFeedbackEventAllSchema } from "./index.js";
22
33 export const chatFeedbackEventSchema_0_1_0 = chatFeedbackEventAllSchema.pick({
4- modelTitle: true,
4+ modelName: true,
55 completionOptions: true,
66 prompt: true,
77 completion: true,
modified packages/config-yaml/src/schemas/data/chatFeedback/v0.2.0.ts +2 −0
@@ -12,6 +12,8 @@
1212 // other
1313 prompt: true,
1414 completion: true,
15+ modelProvider: true,
16+ modelName: true,
1517 modelTitle: true,
1618 feedback: true,
1719 sessionId: true,
modified packages/config-yaml/src/schemas/data/chatInteraction/index.ts +1 −0
@@ -3,6 +3,7 @@
33
44 export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({
55 modelProvider: z.string(),
6+ modelName: z.string(),
67 modelTitle: z.string(),
78 prompt: z.string(),
89 completion: z.string(),
modified packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts +1 −0
@@ -13,6 +13,7 @@
1313 // other
1414 prompt: true,
1515 completion: true,
16+ modelName: true,
1617 modelTitle: true,
1718 modelProvider: true,
1819 sessionId: true,
modified packages/config-yaml/src/schemas/data/editInteraction/index.ts +1 −0
@@ -6,6 +6,7 @@
66 */
77 export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({
88 modelProvider: z.string(),
9+ modelName: z.string(),
910 modelTitle: z.string(),
1011 prompt: z.string(),
1112 completion: z.string(),
modified packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts +1 −0
@@ -13,6 +13,7 @@
1313 // other
1414 prompt: true,
1515 completion: true,
16+ modelName: true,
1617 modelTitle: true,
1718 modelProvider: true,
1819 filepath: true,
modified packages/config-yaml/src/schemas/data/editOutcome/index.ts +1 −0
@@ -3,6 +3,7 @@
33
44 export const editOutcomeEventAllSchema = baseDevDataAllSchema.extend({
55 modelProvider: z.string(),
6+ modelName: z.string(),
67 modelTitle: z.string(),
78 prompt: z.string(),
89 completion: z.string(),
modified packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts +1 −0
@@ -12,6 +12,7 @@
1212 // other
1313 prompt: true,
1414 completion: true,
15+ modelName: true,
1516 modelTitle: true,
1617 modelProvider: true,
1718 accepted: true,
modified packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts +3 −0
@@ -15,4 +15,7 @@
1515 beforeCursorPos: z.object({ line: z.number(), character: z.number() }),
1616 afterCursorPos: z.object({ line: z.number(), character: z.number() }),
1717 context: z.string(),
18+ modelProvider: z.string(),
19+ modelName: z.string(),
20+ modelTitle: z.string(),
1821 });
modified packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts +3 −0
@@ -18,6 +18,9 @@
1818 beforeCursorPos: true,
1919 afterCursorPos: true,
2020 context: true,
21+ modelProvider: true,
22+ modelName: true,
23+ modelTitle: true,
2124 });
2225
2326 export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({