diff --git a/api.go b/api.go index 5c152e9..61c3dbd 100644 --- a/api.go +++ b/api.go @@ -10,10 +10,15 @@ type ToolArgs any type Metadata map[string]any type InterceptionRecord struct { - ID string - InitiatorID, Provider, Model string - Metadata Metadata - StartedAt time.Time + // keep-sorted start + ID string + InitiatorID string + UserAgent string + Provider string + Model string + StartedAt time.Time + Metadata Metadata + // keep-sorted end } type InterceptionRecordEnded struct { diff --git a/interception.go b/interception.go index 9422d01..42a7afe 100644 --- a/interception.go +++ b/interception.go @@ -54,10 +54,11 @@ func newInterceptionProcessor(p Provider, logger slog.Logger, recorder Recorder, if err := recorder.RecordInterception(r.Context(), &InterceptionRecord{ ID: interceptor.ID().String(), - Metadata: actor.metadata, InitiatorID: actor.id, + UserAgent: r.UserAgent(), // TODO make this smarter Provider: p.Name(), Model: interceptor.Model(), + Metadata: actor.metadata, }); err != nil { logger.Warn(r.Context(), "failed to record interception", slog.Error(err)) http.Error(w, "failed to record interception", http.StatusInternalServerError)