Merge pull request #5659 from continuedev/nate/log-inline-edit

Nate/log-inline-edit
This commit is contained in:
Nate Sesti 2025-05-16 18:23:14 -07:00 • committed by GitHub
commit a7b0ff9cf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 3 deletions

View file

@ -15,6 +15,7 @@ import {
import { stripImages } from "core/util/messageContent";
import * as vscode from "vscode";
import { DataLogger } from "core/data/log";
import { EDIT_MODE_STREAM_ID } from "core/edit/constants";
import { ApplyManager } from "../apply";
import { VerticalDiffManager } from "../diff/vertical/manager";
@ -228,6 +229,18 @@ export class VsCodeMessenger {
),
rulesToInclude: config.rules,
});
// Log dev data
await DataLogger.getInstance().logDevData({
name: "editInteraction",
data: {
prompt: stripImages(prompt),
completion: fileAfterEdit ?? "",
modelProvider: model.providerName,
modelTitle: model.title ?? "",
},
});
return fileAfterEdit;
});

View file

@ -1,6 +1,9 @@
import { z } from "zod";
import { baseDevDataAllSchema } from "../base.js";
/**
* The "editInteraction" event is sent whenever the user submits an input in edit mode and the model's response is completed
*/
export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({
modelProvider: z.string(),
modelTitle: z.string(),

View file

@ -23,6 +23,11 @@ import {
chatInteractionEventSchema_0_2_0,
chatInteractionEventSchema_0_2_0_noCode,
} from "./chatInteraction/v0.2.0.js";
import { editInteractionEventAllSchema } from "./editInteraction/index.js";
import {
editInteractionEventSchema_0_2_0,
editInteractionEventSchema_0_2_0_noCode,
} from "./editInteraction/v0.2.0.js";
import { quickEditEventAllSchema } from "./quickEdit/index.js";
import {
quickEditEventSchema_0_1_0,
@ -66,7 +71,7 @@ const devEventAllVersionDataSchemas = z.object({
chatFeedback: chatFeedbackEventAllSchema,
tokensGenerated: tokensGeneratedEventAllSchema,
chatInteraction: chatInteractionEventAllSchema,
// editInteraction: editInteractionEventAllSchema,
editInteraction: editInteractionEventAllSchema,
});
// Version and level specific schemas are organized here
@ -91,14 +96,14 @@ export const devDataVersionedSchemas = {
chatFeedback: chatFeedbackEventSchema_0_2_0,
tokensGenerated: tokensGeneratedEventSchema_0_2_0,
chatInteraction: chatInteractionEventSchema_0_2_0,
// editInteraction: editInteractionEventSchema_0_2_0,
editInteraction: editInteractionEventSchema_0_2_0,
},
noCode: {
autocomplete: autocompleteEventSchema_0_2_0_noCode,
chatFeedback: chatFeedbackEventSchema_0_2_0_noCode,
tokensGenerated: tokensGeneratedEventSchema_0_2_0_noCode,
chatInteraction: chatInteractionEventSchema_0_2_0_noCode,
// editInteraction: editInteractionEventSchema_0_2_0_noCode,
editInteraction: editInteractionEventSchema_0_2_0_noCode,
},
},
};