agenta icon indicating copy to clipboard operation
agenta copied to clipboard

[Bug] Duration not shown for single trace chat sessions

Open mmabrouk opened this issue 10 months ago • 3 comments

Duration is not shown for chat sessions that includes only one trace in the session table

CleanShot 2026-01-09 at 16.43.52.png

mmabrouk avatar Jan 09 '26 15:01 mmabrouk

AGE-3547

linear[bot] avatar Jan 09 '26 15:01 linear[bot]

The missing duration for single-trace chat sessions is caused by the backend not cumulating or setting the acc.duration.total metric for sessions with only one trace. The ingestion pipeline currently applies cumulation helpers for costs and tokens, but there is no equivalent for duration, so the duration field remains unset for these sessions and nothing is displayed in the UI.

To fix this, a cumulation helper for duration (e.g., cumulate_durations) should be added to the backend, similar to how cumulate_costs and cumulate_tokens are implemented and invoked during ingestion. This helper should set acc.duration.total to the unit duration for single-trace sessions, and sum durations for multi-trace sessions. The relevant logic lives in api/oss/src/core/observability/service.py (where ingestion happens) and api/oss/src/core/observability/utils.py (where cumulation helpers are defined)
reference.

As a temporary workaround, you could also consider updating the UI to display a computed duration from the start and end timestamps if the metric is missing, but the root cause is in the backend cumulation logic.

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about agenta Share Dosu with your team

dosubot[bot] avatar Jan 09 '26 15:01 dosubot[bot]

Hi, would love to take this issue

adityadewan22-hub avatar Jan 12 '26 16:01 adityadewan22-hub