Aksel Joonas Reedi commited on
Commit
1bce0eb
·
unverified ·
1 Parent(s): 3eec386

Make the CLI startup banner show the actual CLI default model (#122)

Browse files

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

Files changed (2) hide show
  1. agent/main.py +3 -4
  2. agent/utils/terminal_display.py +1 -1
agent/main.py CHANGED
@@ -831,6 +831,8 @@ async def main():
831
  if not hf_token:
832
  hf_token = await _prompt_and_save_hf_token(prompt_session)
833
 
 
 
834
  # Resolve username for banner
835
  hf_user = None
836
  try:
@@ -839,7 +841,7 @@ async def main():
839
  except Exception:
840
  pass
841
 
842
- print_banner(hf_user=hf_user)
843
 
844
  # Pre-warm the HF router catalog in the background so /model switches
845
  # don't block on a network fetch.
@@ -855,9 +857,6 @@ async def main():
855
  turn_complete_event.set()
856
  ready_event = asyncio.Event()
857
 
858
- # Start agent loop in background
859
- config = load_config(CLI_CONFIG_PATH)
860
-
861
  # Create tool router with local mode
862
  tool_router = ToolRouter(config.mcpServers, hf_token=hf_token, local_mode=True)
863
 
 
831
  if not hf_token:
832
  hf_token = await _prompt_and_save_hf_token(prompt_session)
833
 
834
+ config = load_config(CLI_CONFIG_PATH)
835
+
836
  # Resolve username for banner
837
  hf_user = None
838
  try:
 
841
  except Exception:
842
  pass
843
 
844
+ print_banner(model=config.model_name, hf_user=hf_user)
845
 
846
  # Pre-warm the HF router catalog in the background so /model switches
847
  # don't block on a network fetch.
 
857
  turn_complete_event.set()
858
  ready_event = asyncio.Event()
859
 
 
 
 
860
  # Create tool router with local mode
861
  tool_router = ToolRouter(config.mcpServers, hf_token=hf_token, local_mode=True)
862
 
agent/utils/terminal_display.py CHANGED
@@ -99,7 +99,7 @@ def print_banner(model: str | None = None, hf_user: str | None = None) -> None:
99
  _console.file.write("\033[2J\033[H")
100
  _console.file.flush()
101
 
102
- model_label = model or "bedrock/us.anthropic.claude-opus-4-6-v1"
103
  user_label = hf_user or "not logged in"
104
 
105
  # Warm gold palette matching the shimmer highlight (255, 200, 80)
 
99
  _console.file.write("\033[2J\033[H")
100
  _console.file.flush()
101
 
102
+ model_label = model or "unknown"
103
  user_label = hf_user or "not logged in"
104
 
105
  # Warm gold palette matching the shimmer highlight (255, 200, 80)