Skip to content

feat(cli): per-turn summary line and live token flow in the spinner - #72246

Merged
teknium1 merged 2 commits into
mainfrom
ux/turn-summary
Jul 27, 2026
Merged

feat(cli): per-turn summary line and live token flow in the spinner#72246
teknium1 merged 2 commits into
mainfrom
ux/turn-summary

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Every completed CLI turn now ends with a one-line accounting of what it did — ⋯ 12.4s · edited 2 files +18 -3 · read 4 files · ran 3 commands — and the spinner shows live token flow while the turn runs. Previously Hermes told you nothing about a turn's cost or footprint once the response landed.

Ported from Claude Code, observed live: I ran CC 2.1.220 in a tmux PTY through real edit tasks and watched it print Edited 1 file +6 -2, read 1 file, listed 1 directory / ✻ Worked for 10s after each turn, with ✢ Scurrying… (2s · ↓ 32 tokens) during.

How it works

Display-only, zero agent-loop state: the collector rides the tool-progress feed the CLI display already receives (every tool.completed event carries the tool name and raw result), so nothing new is threaded through run_agent.py. Line deltas come only from tools that already report a diff in their result payload — never by shelling out to git, never by re-reading files. Failed tool calls are excluded so the line can't over-claim "edited 2 files" when a write was denied.

Changes

  • agent/turn_summary.pyTurnSummaryCollector + pure formatters (format_turn_summary, format_token_flow, format_elapsed)
  • cli.py — collector wired into the existing tool-progress handler + spinner token flow
  • hermes_cli/config.pydisplay.turn_summary, display.spinner_token_flow (both default true, no _config_version bump)
  • website/docs/user-guide/configuration.md — both keys documented
  • tests/agent/test_turn_summary.py — 44 tests

Gated: CLI-only (never gateway — that surface has its own runtime footer), suppressed in quiet/non-interactive/batch, both keys individually disable-able.

Validation

Result
scripts/run_tests.sh tests/agent/test_turn_summary.py 44 passed, 0 failed
E2E render against realistic tool payloads ⋯ 12.4s · edited 1 file +2 -1 · read 1 file · ran 1 command

E2E found a defect the unit suite missed: a diff carrying no +/- content lines (bare hunk header) rendered a misleading +0 -0 beside a real edit. Fixed to report unknown deltas instead, with a regression test.

Infographic

turn summary

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on e0372d0

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence upload failed.

Failed to upload diff-665a0833239e-onboarding-overlay-diff.png with gh image (exit code 1): Error uploading /home/runner/work/_temp/e2e-evidence/diff-665a0833239e-onboarding-overlay-diff.png: step 0 (get upload token): uploadToken not found on repo page — do you have write access to NousResearch/hermes-agent? (or, if NousResearch enforces SAML SSO, authorize at https://github.com/orgs/NousResearch/sso)

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Jul 26, 2026
teknium1 added 2 commits July 26, 2026 16:17
Ports Claude Code's post-turn accounting (Edited N files +X -Y · Worked for Ns). Display-only, quiet-mode aware, config-gated.
…f +0 -0

Found by E2E-rendering the collector against realistic tool payloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants