feat(tui): show active credential label in status bar - #66191
feat(tui): show active credential label in status bar#66191alvarosanchez wants to merge 9 commits into
Conversation
|
Independent review follow-up applied in 3a65c4ba7:
Added fallback-snapshot, |
|
UI polish: changed the model/account qualifier from |
There was a problem hiding this comment.
Pull request overview
Adds active credential-pool label visibility to the Hermes TUI status bar by plumbing the selected credential label through backend usage snapshots and rendering it next to the model (with truncation and compact-layout hiding).
Changes:
- Expose the active pooled credential label (sanitized) via
tui_gatewayusage snapshots and ensure stale labels can be cleared. - Render the credential label beside the model in the TUI status rule (with width bounds and compact-mode suppression).
- Add targeted backend + TUI unit tests and update TUI documentation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/user-guide/tui.md | Documents the new “model + active pooled account” status-bar behavior and privacy guidance. |
| ui-tui/src/types.ts | Extends Usage to carry credential_label (and model) through the UI state. |
| ui-tui/src/gatewayTypes.ts | Extends SessionUsageResponse to include credential_label. |
| ui-tui/src/components/appLayout.tsx | Wires credentialLabel and prefers usage-provided model when rendering the status rule. |
| ui-tui/src/components/appChrome.tsx | Implements bounded/truncated credential label rendering in the status bar. |
| ui-tui/src/app/slash/commands/session.ts | Merges /usage RPC snapshots into existing UI usage state instead of overwriting. |
| ui-tui/src/tests/sessionUsageCommand.test.ts | Tests that /usage refresh merges model + credential identity into UI state. |
| ui-tui/src/tests/createGatewayEventHandler.test.ts | Tests that completion snapshots merge credential/model identity into UI state. |
| ui-tui/src/tests/appChromeStatusRule.test.tsx | Adds rendering + truncation tests for the credential label in the status rule. |
| tui_gateway/server.py | Adds active credential label extraction (agent-installed key match) and includes it in usage snapshots. |
| tests/test_tui_gateway_server.py | Adds unit tests for label selection, single-entry suppression, and sanitization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Safety follow-up in
Focused verification ran under macOS |
|
Thanks for the focused TUI visibility improvement. Current The implementation follows the live-agent credential-rotation mechanism: GitHub currently reports the branch as conflicting with Automated hermes-sweeper review. |
|
Resolved the reported conflicts by rebasing onto current Post-rebase verification:
The 19 failures in the canonical TUI suite reproduce unchanged on the exact |
What does this PR do?
Shows the active credential-pool label beside the model in the TUI status bar, for example:
The label identifies the credential actually installed on the main agent. It does not rely on the pool-global
current()pointer, which may temporarily reflect a subagent lease. The label follows credential rotation through normal usage snapshots, is omitted for single-entry pools, and is hidden in compact status layouts.This changeset also hardens the affected gateway tests against real browser and voice/TTS side effects. Pytest now disables inherited interactive voice settings at both process and per-test boundaries, waits for prompt workers before restoring patches, and keeps Linux-only
systemctlprobes portable on platforms wheresystemctlis unavailable.Related Issue
No issue — user-requested TUI visibility improvement plus test-isolation fixes discovered while validating it.
Type of Change
Changes Made
Credential identity and gateway usage
credential_labelin every usage snapshot; an explicit empty value clears stale identity after provider/model changes.TUI status and usage synchronization
<model> · <label>./usageresponses into existing usage state instead of replacing fields, preserving model and credential identity.Test and live-system safety
HERMES_VOICEandHERMES_VOICE_TTSbefore test-module imports and reset both at every test boundary.systemctlpass-through probes only whensystemctlis unavailable, allowing the guard suite to run cleanly on macOS.How to Test
Manual behavior
hermesand verify the footer contains<model> · <credential-label>.Automated verification
Latest GitHub CI is green, including:
ui-tuitypecheck and testsAll required checks passFocused macOS regression verification deliberately inherited hostile interactive settings:
Result: 32 passed, 4 skipped. The skips are the expected Linux-only
systemctlprobes on macOS. Noafplay,say, orffplayprocess remained afterward.Additional local verification:
git diff --check— passednpm run typecheck— passednpm run build— passedChecklist
Code
Documentation & Housekeeping
cli-config.yaml.example— N/A, no config key addedCONTRIBUTING.md/AGENTS.md— N/A, no architecture/workflow change