Show agent turn duration in WebUI#1592
Conversation
|
Thanks @Michaelyklam — duration on the Activity row is the kind of small thing that meaningfully changes how the UI feels during long agent turns. The implementation reads cleanly: backend stores I pulled the branch and ran the new + adjacent suites: Plus a focused sweep across A few notes from the diff
One thing worth double-checking The if s.messages:
for _dm in reversed(s.messages):
if isinstance(_dm, dict) and _dm.get('role') == 'assistant':
_dm['_turnDuration'] = round(_turn_duration_seconds, 3)
breakThat matches how the existing Looking at const sourceMsg=S.messages[aIdx]||{};
if(sourceMsg._turnDuration!==undefined) group.setAttribute('data-turn-duration', String(sourceMsg._turnDuration));
Verdict This is well-scoped, has solid test coverage, and the UX choice to dedupe duration between Activity row and footer is the right call. Will queue for stage review. Thanks for the careful work. |
|
Thanks for the careful review — I made the small cleanup you called out around the start-time fallback. Follow-up commit: What changed:
I also re-checked the multi-step/tool-call UI path you mentioned with a synthetic browser QA turn containing thinking + 3 tools:
Verification:
|
… — 4094→4111 tests - #1586 (Michaelyklam): login asset SW cache exemption - #1590 (Michaelyklam): hot-apply compact tool activity setting - #1591 (Michaelyklam): first-turn sidebar visibility (optimistic upserts) - #1592 (Michaelyklam): turn duration display (Done in 1m 12s) + Opus follow-up (truthy-check on _pending_started_at) - #1464 (JKJameson, maintainer-augmented): workspace dropdown sort+search+chip-sync (rebased + ternary fix + regression test) Maintainer-side test fixes in stage: - tests/test_465_session_branching.py: widen compact() search window 1500→3000 - tests/test_regressions.py: anchor on api('/api/chat/start' instead of comment line Browser API sanity: 11/11 passed. Live UX verification: vision-confirmed dropdown sort+search+empty-state on test server. Opus advisor: SHIP AS-IS.
4559163
Summary
pending_started_attimestamp and include it in the streamingdoneusage payload_turnDurationso reloads keep the displayDone in …on the compact Activity row, and as a subtle assistant footer chip in expanded tool-call modeScreenshots / QA
Done in 1m 12s, no duplicate footer durationDone in 1m 12sLocal browser QA screenshots were captured during validation:
MEDIA:/home/michael/.hermes/cache/screenshots/browser_screenshot_143f3490bff248628f89441683062dbf.pngMEDIA:/home/michael/.hermes/cache/screenshots/browser_screenshot_74f62a3c45ae4d37ab05c898aa850752.pngTests
python -m pytest tests/test_turn_duration_display.py tests/test_ui_tool_call_cleanup.py tests/test_streaming_markdown.py tests/test_sprint42.py tests/test_sprint49.py -q→ 97 passedgit diff --checkpython -m py_compile api/streaming.pypython -m pytest tests/ -qattempted: 4088 passed, 9 failed, 2 skipped. The 9 failures are existing environment/config-sensitive tests unrelated to this change (test_issue1094_provider_bugs.py,test_model_resolver.py, onboarding MVP tests, andtest_sprint28.py::test_personalities_empty_when_none_exist).