Skip to content

fix(cli): sync CLI model/provider from agent after fallback activation#7430

Open
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/7385-cli-model-sync
Open

fix(cli): sync CLI model/provider from agent after fallback activation#7430
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/7385-cli-model-sync

Conversation

@Tranquil-Flow

@Tranquil-Flow Tranquil-Flow commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

After run_conversation() returns, the agent's model and provider may have changed due to _try_activate_fallback(). The status bar already reads agent.model, but self.model (used by /model display, session headers, etc.) was never updated. This syncs both fields back from the agent after each conversation turn.

Related Issue

Closes #7385

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • cli.py: After run_conversation() completes, sync self.model and self.provider from self.agent when they differ.

How to Test

  1. Configure a primary model and a fallback model.
  2. Exhaust or rate-limit the primary provider.
  3. After fallback activates, check that /model and session headers show the fallback model.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15 (Darwin 24.6.0)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

N/A — see commit description and PR diff.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 29, 2026
@Tranquil-Flow Tranquil-Flow force-pushed the fix/7385-cli-model-sync branch from 86fcb9f to 6b7ce0e Compare May 18, 2026 21:03
After run_conversation() returns, the agent's model and provider may
have changed due to _try_activate_fallback(). The status bar already
reads agent.model, but self.model (used by /model display, session
headers, etc.) was never updated. Sync both fields back from the
agent after each conversation turn.

Closes NousResearch#7385
@Tranquil-Flow Tranquil-Flow force-pushed the fix/7385-cli-model-sync branch from 6b7ce0e to 9ee98c7 Compare May 25, 2026 11:08
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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CLI/status bar keeps showing configured primary model after fallback provider is active

2 participants