Skip to content

fix(cli): sync use_gateway in _reconfigure_provider for tts, browser, and web#15349

Closed
nftpoetrist wants to merge 1 commit into
NousResearch:mainfrom
nftpoetrist:fix/issue-15229-reconfigure-provider-use-gateway
Closed

fix(cli): sync use_gateway in _reconfigure_provider for tts, browser, and web#15349
nftpoetrist wants to merge 1 commit into
NousResearch:mainfrom
nftpoetrist:fix/issue-15229-reconfigure-provider-use-gateway

Conversation

@nftpoetrist

Copy link
Copy Markdown
Contributor

What does this PR do?

_reconfigure_provider() updates cloud_provider / backend / tts.provider when the user switches tool providers via hermes setup tools → Reconfigure, but did not update the matching use_gateway flag. _configure_provider() (the initial-setup path) sets use_gateway on all three tool categories; _reconfigure_provider was missing the same assignments.

The omission leaves a stale value in config.yaml:

  • Switching from a Nous-managed provider (use_gateway=True) to a self-hosted one keeps use_gateway=True — requests continue to route through the Nous gateway and the user is billed incorrectly.
  • Switching from a self-hosted provider to a managed one leaves use_gateway unset, so the managed feature does not activate.

Fix: add use_gateway = bool(managed_feature) in the tts_provider, browser_provider, and web_backend blocks of _reconfigure_provider, symmetric with _configure_provider lines 1345, 1357, and 1363. No behavior change for any provider that does not set one of those three keys.

Related Issue

Fixes #15229

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests
  • ♻️ Refactor
  • 🎯 New skill

Changes Made

  • hermes_cli/tools_config.py: add use_gateway = bool(managed_feature) in tts, browser, and web blocks of _reconfigure_provider (+6 lines, refactored to local vars to match _configure_provider style)
  • tests/hermes_cli/test_tools_config.py: add parametrized test covering all 6 combinations (3 tool types × managed/non-managed) + stale-value overwrite case (+27 lines)

How to Test

  1. Configure a Nous-managed browser provider via hermes setup tools — verify config.yaml has browser.use_gateway: true.
  2. Reconfigure to a self-hosted provider (e.g. Browserbase) — verify browser.use_gateway is now false.
  3. Reconfigure back to the managed provider — verify browser.use_gateway is true again.
  4. pytest tests/hermes_cli/test_tools_config.py -v --override-ini="addopts="

Checklist

Code

  • Contributing Guide okundu
  • Conventional Commits
  • Duplicate PR yok
  • Sadece bu fix
  • pytest çalıştırıldı
  • Test eklendi
  • Platform: macOS

Documentation & Housekeeping

  • Docs güncellendi — N/A
  • cli-config.yaml.example — N/A
  • CONTRIBUTING.md/AGENTS.md — N/A
  • Cross-platform impact — N/A (pure config dict logic)
  • Tool descriptions — N/A

… and web

_reconfigure_provider() updates cloud_provider/backend/tts.provider when
switching tool providers via "hermes setup tools → Reconfigure", but did
not update the matching use_gateway flag. _configure_provider() (the
initial-setup path) sets use_gateway on all three tool categories. The
omission in _reconfigure_provider leaves a stale value in config.yaml:
switching from a Nous-managed provider (use_gateway=True) to a self-hosted
one keeps use_gateway=True, continuing to route requests through the Nous
gateway; switching the other way leaves use_gateway unset so the managed
feature does not activate.

Fix: mirror _configure_provider's use_gateway = bool(managed_feature)
assignment in the tts, browser, and web blocks of _reconfigure_provider.
Symmetric across all three tool categories. No behavior change for any
provider that does not set tts_provider, browser_provider, or web_backend.

Fixes NousResearch#15229
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 24, 2026
@nftpoetrist

Copy link
Copy Markdown
Contributor Author

Closing in favour of a rebase onto current main — conflict in tests/hermes_cli/test_tools_config.py resolved in the new branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two browser provider bugs: Camofox missing from registry + reconfigure flow leaks use_gateway

2 participants