Uh oh!
There was an error while loading. Please reload this page.
fix: fallback adapters report the active instance's model/provider - #6690
Open
Fyko wants to merge 2 commits into
Open
fix: fallback adapters report the active instance's model/provider#6690Fyko wants to merge 2 commits into
Fyko wants to merge 2 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
longcw
reviewed
Aug 4, 2026
| def model(self) -> str: | ||
| return "FallbackAdapter" | ||
| """The model of the instance that most recently served a request (the primary before any traffic).""" # noqa: E501 | ||
| return self._active_instance.model |
Contributor
There was a problem hiding this comment.
The nested llm_request span already carries the real gen_ai.request.model, so model can stay "FallbackAdapter".
The only gap is lk.agents.turn.*, whose labels come from MetricsReport at three sites (agent_activity:3380, :3385, :4457). Maybe add a single metrics_metadata property, read at those three sites, splits the histograms and keeps model, ErrorEvent, and the user_turn span stable.
ifTYPE_CHECKING:
from ..llm.chat_contextimportMetricsMetadata@propertydefmetrics_metadata(self) ->MetricsMetadata: # base classes return their own model/providerreturnself._active_instance.metrics_metadata
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
STT/TTS/LLM/realtime fallback adapters now report the
model/providerof the underlying instance that most recently served a request, instead of the hardcoded"FallbackAdapter"/"livekit".Why
Turn metrics and spans read
model/provideroff the top-level component, so with a fallback adapter everylk.agents.turn.*histogram collapses into onemodel_name="FallbackAdapter"series — you can't tell your primary's ttfb from your fallback's. Discussed with the LiveKit team in slack; surfacing the actual provider was agreed on.Semantics: the primary is reported before any traffic, the last instance to produce output after that. Background recovery probes never relabel — the caller never saw their output. The serving streams mark the active instance directly (same delegation pattern as
stt.StreamAdapterand the realtime adapter'scapabilities), no event listening needed.Tests added for all four adapters, including probe-doesn't-relabel and label-follows-recovery cases.