Skip to content

feat: show Codex credential label in CLI status bar - #27712

Open
xianyu997 wants to merge 1 commit into
NousResearch:mainfrom
xianyu997:feat/codex-statusbar-credential-label
Open

feat: show Codex credential label in CLI status bar#27712
xianyu997 wants to merge 1 commit into
NousResearch:mainfrom
xianyu997:feat/codex-statusbar-credential-label

Conversation

@xianyu997

Copy link
Copy Markdown

Summary

  • Show the active OpenAI Codex credential label in the CLI status bar when using the openai-codex provider
  • Prefer the runtime provider source label and fall back to the credential pool label
  • Truncate long labels to keep the status bar compact

Test Plan

  • ./venv/bin/python -m pytest tests/cli/test_cli_status_bar.py -q -o 'addopts='

@xianyu997
xianyu997 force-pushed the feat/codex-statusbar-credential-label branch from 6bd5436 to 4c70ca6 Compare May 18, 2026 02:38
@xianyu997
xianyu997 force-pushed the feat/codex-statusbar-credential-label branch from 4c70ca6 to 6d00af8 Compare May 18, 2026 02:38
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 18, 2026
@teknium1

teknium1 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution — the feature still looks relevant because current main’s CLI status snapshot/rendering has no Codex credential label path (cli.py:3836, cli.py:4161).

Problems

  • The fallback label lookup runs on the status-bar render path and calls load_pool("openai-codex").select() (cli.py:3105-3108 at PR head 6d00af83). On current main, CredentialPool.select() goes through _select_unlocked() (agent/credential_pool.py:1223), which can refresh credentials and mutate/persist pool state, including least-used request_count increments (agent/credential_pool.py:1354-1360) and round-robin priority rotation (agent/credential_pool.py:1362-1368). Status rendering should be read-only.
  • The tests cover _provider_source = "pool:...", but current main’s explicit openai-codex runtime returns source: "explicit" (hermes_cli/runtime_provider.py:1150-1156), so the common explicit-provider path depends on that side-effecting fallback.

Suggested changes

  • Prefer already-resolved runtime state, or use a read-only pool lookup such as CredentialPool.peek() (agent/credential_pool.py:1375-1380) / self._credential_pool set during runtime credential resolution (hermes_cli/cli_agent_setup_mixin.py:125).
  • Add a test for the explicit openai-codex path where _provider_source is "explicit" and the displayed label comes from the active pool entry without selecting/rotating credentials.

Automated hermes-sweeper review.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused status-bar contribution. The requested label is still absent from current main (cli.py:4549-4591, cli.py:5063-5249), but the fallback needs to remain read-only.

Problems

  • PR cli.py:3107 calls CredentialPool.select() during status rendering. On current main, selection can refresh pool entries (agent/credential_pool.py:1527-1528), increment least-used counters (agent/credential_pool.py:1539-1545), or persist round-robin rotation (agent/credential_pool.py:1547-1554). A repaint must not alter credential routing or persisted pool state.
  • The tests cover only pool: sources. Explicit Codex resolution reports source: "explicit" (hermes_cli/runtime_provider.py:1400-1418), so the side-effecting fallback remains untested.

Suggested changes

  • Carry the active label in resolved runtime state and have the snapshot read it; do not select from the pool in the renderer. CredentialPool.peek() is the read-only alternative (agent/credential_pool.py:1560-1565).
  • Add an explicit-provider test that proves rendering does not invoke selection.

Automated hermes-sweeper review.

Comment thread cli.py

pool = load_pool("openai-codex")
if pool and pool.has_credentials():
entry = pool.select()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select() is not a read-only lookup: current main refreshes entries, increments least-used counters, and persists round-robin rotation (agent/credential_pool.py:1527-1554). Calling it from the repeatedly-rendered status snapshot can change the active credential; retain the resolved label or use a read-only lookup instead.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants