Skip to content

fix(gateway): show MoA presets in model picker - #53526

Closed
dodo-reach wants to merge 1 commit into
NousResearch:mainfrom
dodo-reach:pr/gateway-moa-picker-presets
Closed

fix(gateway): show MoA presets in model picker#53526
dodo-reach wants to merge 1 commit into
NousResearch:mainfrom
dodo-reach:pr/gateway-moa-picker-presets

Conversation

@dodo-reach

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the gateway /model picker so MoA presets appear as selectable models under the virtual moa provider.

MoA presets are already exposed in the CLI inventory, and the docs say presets are selectable across Hermes surfaces. However, the gateway picker path calls list_picker_providers() directly, bypassing the CLI inventory code that injects the virtual MoA provider row. As a result, Telegram/Discord-style model pickers showed only real providers/models, not MoA presets.

This adds an explicit include_moa opt-in to list_picker_providers() and enables it from the gateway /model picker path. Existing callers keep the old behavior unless they opt in.

Related Issue

Related to #46081 and #53211, which made/documented MoA presets as selectable virtual models. This PR fixes the gateway picker path that still missed that virtual provider.

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

  • hermes_cli/model_switch.py
    • Adds an opt-in virtual MoA provider row for interactive picker payloads.
    • Keeps existing list_picker_providers() behavior unchanged unless include_moa=True.
  • gateway/slash_commands.py
    • Enables include_moa=True for the gateway /model picker path.
  • tests/hermes_cli/test_list_picker_providers.py
    • Covers MoA preset injection and preserves existing picker filtering contracts.
  • tests/gateway/test_model_command_async_offload.py
    • Covers that the gateway picker requests MoA preset inclusion.

How to Test

  1. Configure MoA presets in config.yaml.
  2. Restart the gateway.
  3. From Telegram, send /model.
  4. Verify Mixture of Agents appears as a provider and its preset names are selectable.

Automated tests run locally:

scripts/run_tests.sh tests/hermes_cli/test_list_picker_providers.py tests/gateway/test_model_command_async_offload.py tests/gateway/test_model_picker_persist.py

Result:

17 tests passed, 0 failed

Manual verification:

  • Tested on macOS via Telegram gateway.
  • Before the fix, /model showed regular providers only.
  • After restarting the gateway with this patch, /model shows the MoA virtual provider and presets (default, battle, smart) as selectable options.

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 targeted tests via scripts/run_tests.sh 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, Telegram gateway

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A; existing docs already describe MoA preset selection across surfaces
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A; gateway picker payload logic only
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

scripts/run_tests.sh tests/hermes_cli/test_list_picker_providers.py tests/gateway/test_model_command_async_offload.py tests/gateway/test_model_picker_persist.py

=== Summary: 3 files, 17 tests passed, 0 failed (100% complete) ===

@dodo-reach
dodo-reach force-pushed the pr/gateway-moa-picker-presets branch from 45b44a1 to 28eaf02 Compare June 27, 2026 09:19
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard 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

Shows MoA presets as a virtual provider in the gateway model picker, making them tappable like normal providers.

Looks Good

  • _prepend_moa_picker_provider correctly builds a virtual provider row with preset names as models
  • include_moa flag is opt-in (defaults to False) — backward compatible
  • Deduplication: existing moa entries are filtered out before prepending
  • Good test coverage: tests for the virtual provider row structure, current-provider detection, and the gateway picker path
  • Complements PR #53548 (which makes /moa one-shot only and routes preset switching through this picker)

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #53561 — your commits were cherry-picked onto current main with your authorship preserved (ed54469d0). Follow-up on top (a5d1f68c7): your change added a second copy of the MoA row builder, so we refactored inventory._moa_provider_row to take a bare current_provider string and reused it from the gateway picker path — one row builder, no drift. Correct diagnosis that the gateway picker bypassed the inventory's virtual row. Thanks!

@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/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery 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.

4 participants