Skip to content

Feature: show elapsed time since last user message in CLI prompt #8541

@xinbenlv

Description

@xinbenlv

Original Request

add a feature, every time send a message to Hermes, it should remember a time (last user message) and every-time it shows prompt such as -hermes- it should display [Ns since last user message] so we can be aware of continuous run. The purpose is to be aware of how fast does it finish executing users' instruction or how often does it require user input.

Agent's Two Cents (could be wrong)

Everything below is the AI agent's best guess based on the current codebase.
Take with a grain of salt — the original request above is the only thing that came from a human.

Problem / Motivation

In long CLI sessions, Hermes can feel “busy but opaque.” When the prompt comes back, there is no immediate signal telling the user how long it has been since their last input, which makes it harder to judge end-to-end latency, completion speed, and how often Hermes is bouncing back for more user input instead of finishing the task.

What We Checked

  • Searched existing issues for variants of last user message, prompt time since last user message, and idle time prompt display; no obvious duplicate was found.
  • Checked cli.py: the CLI already has prompt_toolkit TUI chrome, status fragments, spinner state, and voice/tool timing-related UI paths.
  • Checked repo behavior around session/activity state: there is tracking for other timestamps in cron/gateway paths, but no obvious CLI prompt indicator for “seconds since last user message.”
  • This appears to be a visibility/UX gap, not a missing session system.

Proposed Solution

Add a lightweight CLI prompt/status indicator that records the timestamp of the most recent user-submitted message, then displays an elapsed badge whenever Hermes is idle and showing the prompt again.

Suggested UX shape:

  • prompt returns as normal, but includes an elapsed indicator like [12s since last user message]
  • timer resets immediately when the user submits a new message
  • elapsed time continues to increase while Hermes is waiting for user input
  • compact/narrow-terminal modes should degrade cleanly instead of wrapping badly

Dependencies & Potential Blockers

No major blockers identified.

How to Validate

  • Start hermes in the CLI.
  • Send a message and wait for Hermes to finish.
  • When the prompt returns, it shows an elapsed indicator based on the timestamp of the last submitted user message.
  • Wait a few more seconds without typing; the displayed elapsed value updates or is recomputed correctly on the next prompt render.
  • Send another message; the timer resets from the new user-submit timestamp rather than continuing from the older turn.
  • Narrow-terminal / minimal-TUI mode still renders cleanly without wrapping the prompt/status chrome into garbage.

Best Validation Path

Run hermes, submit a short prompt like say hi, wait for the prompt to return, then pause for ~5–10 seconds and verify the prompt chrome shows the correct elapsed time since the last user message. Repeat with a second prompt to confirm the timer resets. Add a focused CLI unit test around the prompt/status fragment builder so the elapsed label format and reset behavior are covered without requiring a full interactive manual test every time.

Best Human Demo

A short terminal recording (10–15 seconds) showing:

  1. user sends a message,
  2. Hermes responds,
  3. prompt returns with [Ns since last user message],
  4. user waits,
  5. user sends another message and the counter resets.

Scope Estimate

small

Key Files/Modules Likely Involved

  • cli.py
  • tests/cli/
  • tests/test_cli_skin_integration.py
  • optionally hermes_state.py if implementation decides to persist or reuse timestamped session metadata rather than keeping it purely in-memory

Architecture Diagram

User input
   |
   v
CLI submit handler
   |
   |-- record timestamp of latest user message
   v
Agent run / tool execution / streaming output
   |
   v
CLI returns to idle prompt
   |
   |-- prompt/status renderer reads last-user-message timestamp
   |-- computes elapsed seconds
   v
Prompt shown as: Hermes ... [Ns since last user message]

Rough Implementation Sketch

  • Add a small CLI-side state field for last_user_message_at.
  • Update it at the point where user input is accepted for a real turn.
  • Extend the prompt/status fragment rendering code to include an elapsed badge when that timestamp exists.
  • Keep the rendering compact-aware so it behaves nicely in minimal TUI / narrow terminals.
  • Add focused tests for timestamp reset and display formatting.

Open Questions

  • Should the elapsed indicator be recomputed only when the prompt re-renders, or should it live-update while idle?
  • Should this appear in the main prompt line itself, the status bar, or both?
  • Should slash commands like /help and /model also reset the timer, or only normal user chat turns?

Potential Risks or Gotchas

  • Prompt/status chrome in cli.py is already width-sensitive; adding another badge could create ugly wrapping in narrow terminals.
  • If the timer updates too aggressively, it could create unnecessary redraw churn in prompt_toolkit.
  • The exact definition of “last user message” needs to be explicit so command-only interactions do not produce confusing resets.

Related Issues

  • No obvious duplicate found in issue search for prompt-timing / last-user-message display.

Suggested priority: p2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions