Skip to content

fix(eot): report None detection_delay when client timestamp is unset#6494

Open
dhanavanthesh wants to merge 1 commit into
livekit:mainfrom
dhanavanthesh:fix/eot-detection-delay-unset-timestamp
Open

fix(eot): report None detection_delay when client timestamp is unset#6494
dhanavanthesh wants to merge 1 commit into
livekit:mainfrom
dhanavanthesh:fix/eot-detection-delay-unset-timestamp

Conversation

@dhanavanthesh

Copy link
Copy Markdown

When the server doesn't set latest_client_created_at, the protobuf timestamp reads back as epoch 0.
That made detection_delay = now - 0, so a missing timestamp could report a delay of roughly 56 years.
The agent behavior is unaffected, but that bad value can leak into EOT metrics and latency traces.

Before:

unset latest_client_created_at -> detection_delay ~= 56 years

After:

unset latest_client_created_at -> detection_delay = None

The fix uses the same request_sent_at_ms > 0 guard already used by _warn_transport_latency. EOTInferenceMetrics.detection_delay is now float | None, so metrics handlers should handle None for this unknown case.

Includes a regression test for the unset case and a normal-timestamp control.

An unset latest_client_created_at reads back as epoch 0, so `now - 0`
reported a detection_delay of roughly 56 years.

Guard the calculation with the same `> 0` check used by
_warn_transport_latency and report None when the timestamp is unknown.
EOTInferenceMetrics.detection_delay is now float | None.

Add a regression test for the unset case with a normal-timestamp control.
@dhanavanthesh
dhanavanthesh requested a review from a team as a code owner July 21, 2026 08:52
@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants