agents icon indicating copy to clipboard operation
agents copied to clipboard

user_speaking span sometimes has enormous duration_ms

Open pesterhazy opened this issue 1 year ago • 6 comments

In opentelemetry, the user_speaking span sometimes has an excessive length, e.g. 18446744073700.02 ms

Image

This skews the trace when looked at in, e.g., Honeycomb

pesterhazy avatar Sep 10 '25 11:09 pesterhazy

Probably related to this line? https://github.com/livekit/agents/blob/f2fb5705c865ee7f220f60b5baeaf4c716db4cf6/livekit-agents/livekit/agents/voice/agent_session.py#L1060

pesterhazy avatar Sep 10 '25 11:09 pesterhazy

@pesterhazy I made a PR, let me know if that solves the issue!

tinalenguyen avatar Sep 10 '25 19:09 tinalenguyen

@pesterhazy can you share the start and end time of the user speaking span?

longcw avatar Sep 11 '25 00:09 longcw

Hey @longcw and @tinalenguyen I am from Paulus team and sharing more context:

The end_time is earlier:

lk.start_time: 1757614656.088785
lk.end_time: 1757614655.7160554

also take a look here on the distribution of user_speaking durations Image

Also will let you know if it worked out after we update :)

Bnowako avatar Sep 11 '25 19:09 Bnowako

so the actual problem is the end_time < start_time, will take a look. cc @tinalenguyen

longcw avatar Sep 12 '25 00:09 longcw

@longcw @tinalenguyen this issue returned when we bumped from 1.3.9 to 1.3.12

Image

Bnowako avatar Mar 18 '26 14:03 Bnowako