Skip to content

fix: apply moa switches to live tui agent - #53502

Closed
itsflownium wants to merge 1 commit into
NousResearch:mainfrom
itsflownium:fix/tui-moa-live-switch-53444
Closed

fix: apply moa switches to live tui agent#53502
itsflownium wants to merge 1 commit into
NousResearch:mainfrom
itsflownium:fix/tui-moa-live-switch-53444

Conversation

@itsflownium

Copy link
Copy Markdown
Contributor

Problem
TUI/Desktop /moa updated the session model override, but it did not switch the already-running session agent. That meant /moa could show the queued notice while the next turn still ran on the previous single provider.

Summary

  • Add a MoA live-switch helper for the known virtual-provider runtime values.
  • Apply the helper for preset switches and one-shot MoA prompts.
  • Restore both the session override and the live agent after one-shot prompts, including cleanup paths.
  • Extend command-dispatch tests to assert the live agent actually switches and restores.

Validation

  • $HOME/.hermes/hermes-agent/venv/bin/python -m pytest -q tests/tui_gateway/test_goal_command.py
  • $HOME/.hermes/hermes-agent/venv/bin/python -m pytest -q tests/tui_gateway/test_goal_command.py -k moa
  • $HOME/.hermes/hermes-agent/venv/bin/ruff check tui_gateway/server.py tests/tui_gateway/test_goal_command.py
  • git diff --check

Fixes #53444

@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have labels Jun 27, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved

Applies MoA (Mixture of Agents) model switches live to the TUI agent via _apply_live_model_override(). Includes proper restore logic for one-shot MoA via _restore_moa_one_shot() with fallback on failure. Well-tested with _FakeAgent mock and dedicated tests for both preset and one-shot paths.


Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Superseded by #53548 (merged to main as 50f68552), which fixes the same #53444 bug — the TUI /moa one-shot set session["model_override"] but never switched the already-built cached agent, so the turn silently ran on the previous model. #53548 now does a real in-place agent.switch_model() via _apply_model_switch() for the one-shot (with restore after the turn), and falls back to a model_override for lazy/unbuilt sessions.

One deliberate difference: your PR also keeps the sticky preset-switch path (/moa <preset> switches the session). We removed that on purpose in #53548/moa is now one-shot-only sugar, and switching to a MoA preset for the session is done through the model picker, where presets surface under a virtual Mixture of Agents provider. So re-adding the live switch for the sticky path would reintroduce behavior we just retired.

Thanks for the fix and the clear root-cause writeup — you diagnosed the cached-agent issue exactly right, same as the merged change. Closing as superseded.

@teknium1 teknium1 closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) 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.

feat: Rethink MoA architecture — virtual provider is overkill, subagent delegation is simpler and more robust

4 participants