mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 11:10:18 +00:00
14fac05dc9
Switch the per-turn duration fallback from `is not None` to a truthy check so None, missing-attr, and an explicit 0 all uniformly fall back to time.time(). Without this, a 0 timestamp (e.g. via a buggy migration or manual file edit) would yield `time.time() - 0` ≈ wall-clock-since-epoch, displaying nonsense like 'Done in 56 years 4 months ...'. In practice pending_started_at is always set via int(time.time()) so this is a hardening fix, not a live-bug fix. Also drop the brittle source-string assertion in the regression test that pinned the literal expression. The behavioural test test_done_handler_persists_duration_on_last_assistant_message already proves the duration field is set; pinning the source line broke twice during the v0.50.290 release pipeline alone (Opus tightening + maintainer revert). Fixes #1595 Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>