From 5942d0d8ab803ec8315dd8ceed3acec4e138b382 Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Mon, 2 Mar 2026 23:09:59 +0100 Subject: [PATCH] add metrics to repl --- pkg/repl/repl.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/repl/repl.go b/pkg/repl/repl.go index 0c999f0..091d0f0 100644 --- a/pkg/repl/repl.go +++ b/pkg/repl/repl.go @@ -100,10 +100,15 @@ func (r *REPL) Run(ctx context.Context, config app.Config) error { // If the user types "exit" or "quit", break the loop and exit the REPL. if input == "exit" || input == "quit" { + r.logAction("repl exit requested") fmt.Println("Goodbye!") break } + if input != "" { + r.logAction("repl command: " + input) + } + // Add the input to the history for future navigation. history = append(history, input) @@ -144,3 +149,12 @@ func (r *REPL) SetChannels(feedbackChan chan task.ValidationFeedback, quitChan c r.feedbackChan = feedbackChan r.quitChan = quitChan } + +func (r *REPL) logAction(action string) { + if r.app != nil { + r.app.LogAction(models.EncodeActionEvent(models.ActionEvent{ + Source: "repl", + Action: action, + })) + } +}