-
Notifications
You must be signed in to change notification settings - Fork 379
feat(telemetry): interruption detail, handoff span, fallback events, text input #2499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
baddc76
feat(telemetry): interruption detail, handoff span, fallback events, …
davidzhao 190c177
review: STT identity fallback, interruption verdict in finally, fallb…
davidzhao 5320e25
review: served-instance attribution for TTS metrics and partial chunk…
davidzhao b934f32
review: the STT fallback adapter credits a transcript to the child se…
davidzhao b9709d2
review: the served STT slot belongs to the stream that elected it
davidzhao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@livekit/agents': patch | ||
| --- | ||
|
|
||
| Telemetry coverage: `lk.interruption.source` and `lk.playout.position` on `agent_turn`, an `update_agent` span grouping agent handoffs, fallback adapters reporting the instance that serves (`lk.fallback.label`/`index`, response model on the request and node spans), and a `keyterm_detection` span for the keyterm-detection LLM pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Recovered primary misattributes fallback usage
When primary recovery finishes before metrics finalize,
modelandproviderswitch back despite the secondary serving. The secondary's usage is attributed to the primary.Learn more
Fallback streams emit wrapper-level metrics after output collection. Those metrics read the adapter's dynamic
modelandproviderthrough monitorMetrics. A failed primary starts recovery immediately, and recovery can mark it available while the secondary request is still running. The getters then select the primary even thoughservedLlmcorrectly records the secondary on spans. The same timing can affect wrapper-level TTS metrics because its fallback adapter uses equivalent dynamic getters.Example: The primary fails, then its probe succeeds while the secondary is generating. The secondary returns 100 tokens. By metric finalization,
nextInstance()selects the recovered primary, so those 100 tokens carry the primary model and provider.Recommended fix: Store the serving child per fallback stream and use that child for wrapper metrics. Extend the base LLM/TTS metric construction with protected model/provider getters, analogous to
responseModel, then override them in fallback streams. Keep adapter-level getters for pre-request attribution.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codex found the same issue:
modelandprovidergetters now return primary.