fix(cli): sync use_gateway in _reconfigure_provider for tts, browser, and web#15349
Closed
nftpoetrist wants to merge 1 commit into
Closed
Conversation
… 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
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. |
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
_reconfigure_provider()updatescloud_provider/backend/tts.providerwhen the user switches tool providers via hermes setup tools → Reconfigure, but did not update the matchinguse_gatewayflag._configure_provider()(the initial-setup path) setsuse_gatewayon all three tool categories;_reconfigure_providerwas missing the same assignments.The omission leaves a stale value in
config.yaml:use_gateway=True) to a self-hosted one keepsuse_gateway=True— requests continue to route through the Nous gateway and the user is billed incorrectly.use_gatewayunset, so the managed feature does not activate.Fix: add
use_gateway = bool(managed_feature)in thetts_provider,browser_provider, andweb_backendblocks of_reconfigure_provider, symmetric with_configure_providerlines 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
Changes Made
hermes_cli/tools_config.py: adduse_gateway = bool(managed_feature)in tts, browser, and web blocks of_reconfigure_provider(+6 lines, refactored to local vars to match_configure_providerstyle)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
hermes setup tools— verifyconfig.yamlhasbrowser.use_gateway: true.browser.use_gatewayis nowfalse.browser.use_gatewayistrueagain.pytest tests/hermes_cli/test_tools_config.py -v --override-ini="addopts="Checklist
Code
Documentation & Housekeeping