fix(tools): run _run_post_setup() in _reconfigure_provider() for parity (salvage #26642) - #27306
Merged
Conversation
…viders _configure_provider() calls _run_post_setup() after collecting env vars (line 2286). _reconfigure_provider() did not — providers with both env_vars and post_setup (Browserbase, Browser Use, Firecrawl, Camofox) skipped the installation step on reconfiguration. Fix: mirror the _configure_provider() call. post_setup hooks are idempotent (check before installing), so no behaviour change for users who already have the dependencies installed.
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-argument-type |
1 |
First entries
tests/hermes_cli/test_tools_config.py:1016: [invalid-argument-type] invalid-argument-type: Argument to function `_reconfigure_provider` is incorrect: Expected `dict[Unknown, Unknown]`, found `str | dict[str, str | list[Unknown] | bool | list[str]] | dict[str, str | list[Unknown]] | dict[str, str | list[dict[str, str]]] | Unknown`
✅ Fixed issues: none
Unchanged: 4370 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
This comment was marked as spam.
This comment was marked as spam.
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.
Summary
Salvage of #26642 —
_reconfigure_provider()skipped the_run_post_setup()call that_configure_provider()runs on first-time setup (line 2286). For providers with both env vars AND a post-setup hook (Browserbase, Browser Use, Firecrawl, Camofox), reconfiguring viahermes toolssaved the env values but never rannpm install— the browser tool then failed silently at runtime._run_post_setup()handles auto-install for browser node deps, Chromium, Camoufox engine, local TTS engines, etc. — seehermes_cli/tools_config.py:671. Without it, reconfigure is half a setup.Changes
hermes_cli/tools_config.py— 3-line parity fix in_reconfigure_provider().tests/hermes_cli/test_tools_config.py— parametrized test asserting post_setup fires for the four affected browser providers.Validation
scripts/run_tests.sh tests/hermes_cli/test_tools_config.py -q→ 70/70 pass.ruff checkclean.Original PR: #26642 — credit preserved via rebase-merge.