Skip to content

Commit a7b0ff9

Browse files
authored
Merge pull request #5659 from continuedev/nate/log-inline-edit
Nate/log-inline-edit
2 parents 129dfbe + 8cb7857 commit a7b0ff9

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

extensions/vscode/src/extension/VsCodeMessenger.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { stripImages } from "core/util/messageContent";
1616
import * as vscode from "vscode";
1717

18+
import { DataLogger } from "core/data/log";
1819
import { EDIT_MODE_STREAM_ID } from "core/edit/constants";
1920
import { ApplyManager } from "../apply";
2021
import { VerticalDiffManager } from "../diff/vertical/manager";
@@ -228,6 +229,18 @@ export class VsCodeMessenger {
228229
),
229230
rulesToInclude: config.rules,
230231
});
232+
233+
// Log dev data
234+
await DataLogger.getInstance().logDevData({
235+
name: "editInteraction",
236+
data: {
237+
prompt: stripImages(prompt),
238+
completion: fileAfterEdit ?? "",
239+
modelProvider: model.providerName,
240+
modelTitle: model.title ?? "",
241+
},
242+
});
243+
231244
return fileAfterEdit;
232245
});
233246

packages/config-yaml/src/schemas/data/editInteraction/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { z } from "zod";
22
import { baseDevDataAllSchema } from "../base.js";
33

4+
/**
5+
* The "editInteraction" event is sent whenever the user submits an input in edit mode and the model's response is completed
6+
*/
47
export const editInteractionEventAllSchema = baseDevDataAllSchema.extend({
58
modelProvider: z.string(),
69
modelTitle: z.string(),

packages/config-yaml/src/schemas/data/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import {
2323
chatInteractionEventSchema_0_2_0,
2424
chatInteractionEventSchema_0_2_0_noCode,
2525
} from "./chatInteraction/v0.2.0.js";
26+
import { editInteractionEventAllSchema } from "./editInteraction/index.js";
27+
import {
28+
editInteractionEventSchema_0_2_0,
29+
editInteractionEventSchema_0_2_0_noCode,
30+
} from "./editInteraction/v0.2.0.js";
2631
import { quickEditEventAllSchema } from "./quickEdit/index.js";
2732
import {
2833
quickEditEventSchema_0_1_0,
@@ -66,7 +71,7 @@ const devEventAllVersionDataSchemas = z.object({
6671
chatFeedback: chatFeedbackEventAllSchema,
6772
tokensGenerated: tokensGeneratedEventAllSchema,
6873
chatInteraction: chatInteractionEventAllSchema,
69-
// editInteraction: editInteractionEventAllSchema,
74+
editInteraction: editInteractionEventAllSchema,
7075
});
7176

7277
// Version and level specific schemas are organized here
@@ -91,14 +96,14 @@ export const devDataVersionedSchemas = {
9196
chatFeedback: chatFeedbackEventSchema_0_2_0,
9297
tokensGenerated: tokensGeneratedEventSchema_0_2_0,
9398
chatInteraction: chatInteractionEventSchema_0_2_0,
94-
// editInteraction: editInteractionEventSchema_0_2_0,
99+
editInteraction: editInteractionEventSchema_0_2_0,
95100
},
96101
noCode: {
97102
autocomplete: autocompleteEventSchema_0_2_0_noCode,
98103
chatFeedback: chatFeedbackEventSchema_0_2_0_noCode,
99104
tokensGenerated: tokensGeneratedEventSchema_0_2_0_noCode,
100105
chatInteraction: chatInteractionEventSchema_0_2_0_noCode,
101-
// editInteraction: editInteractionEventSchema_0_2_0_noCode,
106+
editInteraction: editInteractionEventSchema_0_2_0_noCode,
102107
},
103108
},
104109
};

0 commit comments

Comments
 (0)