Skip to content

Fix CLI banner model label#122

Merged
akseljoonas merged 1 commit intomainfrom
codex/fix-cli-banner-model-20260425-230406
Apr 25, 2026
Merged

Fix CLI banner model label#122
akseljoonas merged 1 commit intomainfrom
codex/fix-cli-banner-model-20260425-230406

Conversation

@akseljoonas
Copy link
Copy Markdown
Collaborator

Summary

  • load the CLI config before printing the startup banner
  • pass the loaded CLI model into print_banner()
  • remove the stale hardcoded Bedrock fallback label from the banner helper

Testing

  • python -m compileall agent/main.py agent/utils/terminal_display.py

The CLI already loads direct Anthropic defaults from
configs/cli_agent_config.json, but the startup banner was rendered before
that config was loaded and fell back to a hardcoded Bedrock label. This
made the CLI look misconfigured even when the session model was correct.

Constraint: The startup banner must reflect the same model source the CLI session will actually use
Rejected: Keep a hardcoded Bedrock fallback in print_banner | it misreports the active CLI default
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Banner/status UI should derive model labels from loaded config or session state, never from stale hardcoded defaults
Tested: python -m compileall agent/main.py agent/utils/terminal_display.py
Not-tested: Interactive manual CLI launch in this sandbox
@claude
Copy link
Copy Markdown

claude Bot commented Apr 25, 2026

Claude finished @akseljoonas's task in 57s —— View job


PR Review: Fix CLI banner model label

  • Gather context and read changed files
  • Review diff and analyze correctness
  • Post review findings

LGTM
Verdict: ready to merge

What I checked

  • agent/main.py reorder: load_config(CLI_CONFIG_PATH) is moved from ~line 857 (after print_banner) to ~line 834 (before it). load_config is pure file I/O + env-var substitution with no dependency on hf_token or other runtime state (agent/config.py:89-105), so moving it earlier is safe. The old config = load_config(...) block at line ~857 was removed; config is now loaded exactly once.
  • print_banner call site (agent/main.py:844): config.model_name is a required str field (agent/config.py:24) — it will always be populated by load_config, so the banner will always receive a real model string, never None.
  • Fallback change (agent/utils/terminal_display.py:102): "bedrock/us.anthropic.claude-opus-4-6-v1""unknown". This fallback now only fires if print_banner is called without an argument from some other call site, which doesn't currently exist. "unknown" is an honest sentinel; the Bedrock string was both stale and misleading.
  • headless_main: unaffected — it never calls print_banner.
  • Double-load risk: none — the old second load_config assignment was cleanly removed.

@akseljoonas akseljoonas merged commit 1bce0eb into main Apr 25, 2026
1 check passed
@akseljoonas akseljoonas deleted the codex/fix-cli-banner-model-20260425-230406 branch April 25, 2026 20:04
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.

1 participant