mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 01:51:21 +08:00
Merge pull request #6152 from Kilo-Org/feat/plan-mode-telemetry
feat(telemetry): add plan followup tracking
This commit is contained in:
@@ -15,6 +15,7 @@ export enum TelemetryEvent {
|
||||
COMMAND_USED = "Command Used",
|
||||
TOOL_USED = "Tool Used",
|
||||
AGENT_USED = "Agent Used",
|
||||
PLAN_FOLLOWUP = "Plan Followup",
|
||||
|
||||
// Share Events
|
||||
SHARE_CREATED = "Share Created",
|
||||
|
||||
@@ -162,6 +162,10 @@ export namespace Telemetry {
|
||||
track(TelemetryEvent.AGENT_USED, { agent, sessionId })
|
||||
}
|
||||
|
||||
export function trackPlanFollowup(sessionId: string, choice: "new_session" | "continue" | "custom" | "dismissed") {
|
||||
track(TelemetryEvent.PLAN_FOLLOWUP, { sessionId, choice })
|
||||
}
|
||||
|
||||
// Share
|
||||
export function trackShareCreated(sessionId: string) {
|
||||
track(TelemetryEvent.SHARE_CREATED, { sessionId })
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Telemetry } from "@kilocode/kilo-telemetry"
|
||||
import { Agent } from "@/agent/agent"
|
||||
import { Bus } from "@/bus"
|
||||
import { TuiEvent } from "@/cli/cmd/tui/event"
|
||||
@@ -237,12 +238,19 @@ export namespace PlanFollowup {
|
||||
if (!user || user.role !== "user" || !user.model) return "break"
|
||||
|
||||
const answers = await prompt({ sessionID: input.sessionID, abort: input.abort })
|
||||
if (!answers) return "break"
|
||||
if (!answers) {
|
||||
Telemetry.trackPlanFollowup(input.sessionID, "dismissed")
|
||||
return "break"
|
||||
}
|
||||
|
||||
const answer = answers[0]?.[0]?.trim()
|
||||
if (!answer) return "break"
|
||||
if (!answer) {
|
||||
Telemetry.trackPlanFollowup(input.sessionID, "dismissed")
|
||||
return "break"
|
||||
}
|
||||
|
||||
if (answer === ANSWER_NEW_SESSION) {
|
||||
Telemetry.trackPlanFollowup(input.sessionID, "new_session")
|
||||
await startNew({
|
||||
sessionID: input.sessionID,
|
||||
plan,
|
||||
@@ -254,6 +262,7 @@ export namespace PlanFollowup {
|
||||
}
|
||||
|
||||
if (answer === ANSWER_CONTINUE) {
|
||||
Telemetry.trackPlanFollowup(input.sessionID, "continue")
|
||||
await inject({
|
||||
sessionID: input.sessionID,
|
||||
agent: "code",
|
||||
@@ -263,6 +272,7 @@ export namespace PlanFollowup {
|
||||
return "continue"
|
||||
}
|
||||
|
||||
Telemetry.trackPlanFollowup(input.sessionID, "custom")
|
||||
await inject({
|
||||
sessionID: input.sessionID,
|
||||
agent: "plan",
|
||||
|
||||
Reference in New Issue
Block a user