Skip to content

Canonicalize OpenRouter model selection across CLI, Telegram, and Discord#9418

Closed
g-guthrie wants to merge 72 commits into
NousResearch:mainfrom
g-guthrie:codex/anti-bloat-integration
Closed

Canonicalize OpenRouter model selection across CLI, Telegram, and Discord#9418
g-guthrie wants to merge 72 commits into
NousResearch:mainfrom
g-guthrie:codex/anti-bloat-integration

Conversation

@g-guthrie

Copy link
Copy Markdown
Contributor

Summary

This PR canonicalizes OpenRouter model selection across the three interactive picker surfaces:

  • CLI /model
  • Telegram /model
  • Discord /model

Instead of relying on a short hardcoded OpenRouter model list, Hermes now uses one canonical OpenRouter picker backend and groups OpenRouter models by vendor/provider before presenting them to users.

What changed

  • added a dedicated OpenRouter picker backend in hermes_cli/openrouter_catalog.py
  • made OpenRouter model discovery dynamic instead of hand-maintained
  • added canonical vendor grouping for OpenRouter models
  • wired the CLI picker to use that grouped OpenRouter backend
  • wired Telegram and Discord model pickers to consume the same grouped OpenRouter data shape
  • preserved the existing switch pipeline by mapping grouped OpenRouter picker entries back to provider=openrouter at selection time

Why

OpenRouter now exposes too many models for a flat picker to be usable.

Previously:

  • some OpenRouter selection paths still depended on a curated shortlist
  • different surfaces were drifting toward different OpenRouter selection behavior

Now:

  • OpenRouter selection is grouped by vendor everywhere
  • all three interactive picker surfaces use the same backend model-selection logic
  • the implementation is more atomic and easier to reason about

Scope

This PR is intentionally limited to OpenRouter model selection.

Not included:

  • unrelated dependency or infrastructure changes
  • cross-provider picker protocol refactors
  • broader model-catalog cleanup outside the OpenRouter path

Testing

Ran:

  • venv/bin/python -m pytest tests/cli/test_cli_model_picker.py tests/gateway/test_model_picker_integration.py tests/gateway/test_telegram_approval_buttons.py tests/hermes_cli/test_models.py tests/hermes_cli/test_model_selection.py tests/hermes_cli/test_model_validation.py tests/hermes_cli/test_model_provider_persistence.py tests/hermes_cli/test_opencode_go_in_model_list.py tests/hermes_cli/test_overlay_slug_resolution.py tests/hermes_cli/test_model_switch_custom_providers.py -q

Result:

  • 150 passed

g-guthrie and others added 30 commits April 11, 2026 01:57
- move CLI and gateway startup onto the shared runtime config loader
- centralize env bridging and runtime config normalization in hermes_cli.config
- fix get_missing_config_fields() to compare against raw user config
- add focused tests for runtime defaults and shared auxiliary env bridging
# Conflicts:
#	gateway/platforms/matrix.py
#	hermes_cli/auth.py
#	hermes_cli/main.py
#	hermes_cli/models.py
#	hermes_cli/providers.py
#	plugins/memory/honcho/__init__.py
#	trajectory_compressor.py
# Conflicts:
#	cli.py
#	hermes_cli/commands.py
#	hermes_cli/config.py
#	plugins/memory/honcho/__init__.py
#	trajectory_compressor.py
# Conflicts:
#	hermes_cli/config.py
#	plugins/memory/honcho/__init__.py
#	trajectory_compressor.py
# Conflicts:
#	hermes_cli/config.py
#	plugins/memory/honcho/__init__.py
#	trajectory_compressor.py
@g-guthrie

Copy link
Copy Markdown
Contributor Author

Closing this draft because the branch history includes the broader anti-bloat integration stack. Reopening this OpenRouter work as a correctly based stacked draft with an atomic diff.

@g-guthrie g-guthrie closed this Apr 14, 2026
jankadlecek added a commit to jankadlecek/hermes-agent that referenced this pull request May 24, 2026
OpenAI's "Enable device code authorization for Codex" toggle in ChatGPT
Settings is broken/missing for many account types since early 2026
(openai/codex NousResearch#9253, NousResearch#9282, NousResearch#9327, NousResearch#9418). Hermes dashboard's KEYS →
Codex LOGIN button uses device code internally, so it fails out of the
box. Local `codex login` uses PKCE with a localhost callback and is
unaffected, so let the operator do that login on their Mac and ship
the resulting tokens to the container via a base64 env var.

The bootstrap runs once when CODEX_AUTH_JSON_B64 is set AND the Hermes
auth store does not yet exist on the volume. It writes both the Codex
CLI shared file and the Hermes auth.json with active_provider set to
"openai-codex", so Hermes's auto-detect picks Codex without needing
any further dashboard interaction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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