Conversation
🦋 Changeset detectedLatest commit: 74e329b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
📝 WalkthroughWalkthroughThis PR introduces adaptive interruption detection infrastructure with HTTP and WebSocket transports, metrics collection and model usage aggregation, turn handling configuration system, and enhanced telemetry with provider/model metadata propagation across LLM, STT, and TTS services. Changes
Sequence Diagram(s)sequenceDiagram
actor AudioSource
participant AudioRecognition
participant InterruptionStream
participant HttpTransport
participant InferenceAPI
participant AudioAgent
AudioSource->>AudioRecognition: audio frames
AudioRecognition->>InterruptionStream: Int16Array chunks<br/>(with overlap tracking)
InterruptionStream->>InterruptionStream: accumulate & resample<br/>to configured sample rate
InterruptionStream->>HttpTransport: audio frames + threshold
HttpTransport->>HttpTransport: batch frames, generate<br/>access token
HttpTransport->>InferenceAPI: POST /bargein<br/>(audio, token, timestamp)
InferenceAPI-->>HttpTransport: { is_bargein, probabilities,<br/>created_at, prediction_duration }
HttpTransport->>HttpTransport: cache entry, compute<br/>probability via sliding window
alt Interruption Detected (probability > threshold)
HttpTransport->>InterruptionStream: InterruptionEvent
InterruptionStream->>AudioAgent: emit interruption event<br/>(timestamp, duration, probability)
AudioAgent->>AudioAgent: handle user interruption<br/>(pause generation, etc.)
else No Interruption
HttpTransport->>InterruptionStream: continue processing
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
💡 Codex Reviewagents-js/agents/src/inference/interruption/http_transport.ts Lines 130 to 134 in d83d7b6 When the detector is configured with a non‑inference ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
|
||
| // `SpeechData.endTime` is in seconds relative to audio start, while `inputStartedAt` and | ||
| // `ignoreUserTranscriptUntil` are epoch milliseconds. | ||
| return alternative.endTime * 1000 + this.inputStartedAt < this.ignoreUserTranscriptUntil; |
Summary by CodeRabbit
New Features
Chores