Skip to content

Enrich /status command with tokens, cost, provider, profile (#463)#1156

Closed
bergeouss wants to merge 2 commits intonesquena:masterfrom
bergeouss:feat/issue-463-status-command
Closed

Enrich /status command with tokens, cost, provider, profile (#463)#1156
bergeouss wants to merge 2 commits intonesquena:masterfrom
bergeouss:feat/issue-463-status-command

Conversation

@bergeouss
Copy link
Copy Markdown
Contributor

Thinking Path

Issue #463 requests that the /status slash command display more information matching the CLI agent's /status output. Currently the WebUI's /status only shows basic session info (title, model, workspace, personality, message count, agent running). Missing: provider, profile, started time, token usage with cost.

What Changed

Backend (api/session_ops.py)

  • session_status() now returns input_tokens, output_tokens, total_tokens, estimated_cost alongside existing fields
  • These were previously only available via the separate /api/session/usage endpoint

Frontend (static/commands.js)

  • cmdStatus() now displays:
    • Provider (from window._activeProvider)
    • Profile (from S.activeProfile, defaults to "default")
    • Started (session creation timestamp, human-readable)
    • Tokens (input/output breakdown + total)
    • Cost (estimated cost in USD, shown when available)
    • All existing fields preserved

i18n (static/i18n.js)

  • Added keys: status_profile, status_started, status_tokens, status_no_tokens, status_unknown
  • Added in en, zh-Hant, ko locales (other locales fall back to en, matching the existing pattern for /status keys)

Tests (tests/test_session_ops.py)

  • Extended test_status_returns_summary to verify the 4 new fields exist and default to 0 for fresh sessions

Closes #463

…arted time (nesquena#463)

- Backend: session_status() now includes input_tokens, output_tokens,
  total_tokens, estimated_cost (previously only in /usage endpoint)
- Frontend: cmdStatus() shows provider, profile, started timestamp,
  token usage with cost, alongside existing fields
- i18n: added status_profile, status_started, status_tokens,
  status_no_tokens, status_unknown keys in en, zh-Hant, ko locales
- Tests: extended test_status_returns_summary to verify new fields
…#1156)

CI locale tests require all English keys present in every locale.
Added status_profile, status_started, status_tokens, status_no_tokens,
status_unknown with English placeholder values to ru, es, de, zh.
@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Good implementation of the enriched /status command, @bergeouss! This closes #463 cleanly.

The approach of pulling input_tokens, output_tokens, total_tokens, and estimated_cost directly from the session object in session_status() (rather than making a second call to /api/session/usage) is the right way to avoid redundant work.

The frontend additions in cmdStatus() look complete:

  • Provider from window._activeProvider
  • Profile from S.activeProfile with "default" fallback
  • Session start timestamp in human-readable form
  • Token breakdown (input / output / total) + cost

The i18n approach — adding keys for en, zh-Hant, ko with other locales falling back to en — matches the existing /status key pattern in the codebase, so no consistency issues there.

The test extension verifying the 4 new fields exist and default to 0 for fresh sessions is the right minimal regression coverage for the backend change.

nesquena-hermes added a commit that referenced this pull request Apr 27, 2026
Merged as v0.50.227. 2634 tests passing, browser QA 21/21 (desktop + mobile). Full attribution below.

Thanks to all 12 contributors:
@jundev0001 (#1138), @franksong2702 (#1142, #1157, #1162), @dso2ng (#1143), @bergeouss (#1145, #1146, #1156, #1159), @jasonjcwu (#1149), @ccqqlo (#1161), @frap129 (#1165)

Two fixes applied during integration and two more by the independent reviewer (@nesquena):
- messages.js: per-turn cost delta capture order (#1159)
- workspace.py: symlink target blocked-roots check + HOME sanity guard (#1149, #1165)
- panels.js: cron unread counter bookkeeping (in-loop increment bug)
- tests/test_symlink_cycle_detection.py: register workspace before session/new
@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Merged as v0.50.227 via batch PR #1168. Thank you @bergeouss! 🎉

JKJameson pushed a commit to JKJameson/hermes-webui that referenced this pull request Apr 29, 2026
Merged as v0.50.227. 2634 tests passing, browser QA 21/21 (desktop + mobile). Full attribution below.

Thanks to all 12 contributors:
@jundev0001 (nesquena#1138), @franksong2702 (nesquena#1142, nesquena#1157, nesquena#1162), @dso2ng (nesquena#1143), @bergeouss (nesquena#1145, nesquena#1146, nesquena#1156, nesquena#1159), @jasonjcwu (nesquena#1149), @ccqqlo (nesquena#1161), @frap129 (nesquena#1165)

Two fixes applied during integration and two more by the independent reviewer (@nesquena):
- messages.js: per-turn cost delta capture order (nesquena#1159)
- workspace.py: symlink target blocked-roots check + HOME sanity guard (nesquena#1149, nesquena#1165)
- panels.js: cron unread counter bookkeeping (in-loop increment bug)
- tests/test_symlink_cycle_detection.py: register workspace before session/new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: /status command — at-a-glance session info card in Web UI

2 participants