MCPcopy Index your code
hub / github.com/coder/coder / RecordInterceptionEnded

Method RecordInterceptionEnded

aibridge/recorder/recorder.go:192–206  ·  view source on GitHub ↗
(ctx context.Context, req *InterceptionRecordEnded)

Source from the content-addressed store, hash-verified

190}
191
192func (a *AsyncRecorder) RecordInterceptionEnded(ctx context.Context, req *InterceptionRecordEnded) error {
193 a.wg.Add(1)
194 go func() {
195 defer a.wg.Done()
196 timedCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), a.timeout)
197 defer cancel()
198
199 err := a.wrapped.RecordInterceptionEnded(timedCtx, req)
200 if err != nil {
201 a.logger.Warn(timedCtx, "failed to record interception end", slog.F("type", "prompt"), slog.Error(err), slog.F("payload", req))
202 }
203 }()
204
205 return nil // Caller is not interested in error.
206}
207
208func (a *AsyncRecorder) RecordPromptUsage(ctx context.Context, req *PromptUsageRecord) error {
209 a.wg.Add(1)

Callers 1

newInterceptionProcessorFunction · 0.95

Calls 4

AddMethod · 0.65
DoneMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected