fix(cli): run computer use post-setup when enabling tool (#22776) - #30316
Merged
Conversation
Contributor
🔎 Lint report:
|
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.
Salvages #22776 onto current main. Closes a silent-no-op bug in the
hermes toolsenable flow.The problem
Computer Use is a "no-key" provider — there are no env vars to ask the user about. So when a returning user toggled it on via
hermes tools,_toolset_needs_configuration_prompt()returned False (correctly: nothing to configure), the provider-setup flow was skipped, and thepost_setuphook that runsinstall_cua_driver()never fired. Result: cua-driver stayed uninstalled, but the toolset showed as enabled.The fix
Three layered changes in
hermes_cli/tools_config.py:_POST_SETUP_INSTALLEDregistry — explicit opt-in dict mapping post_setup keys to a "is the side-effect already satisfied?" predicate. Only entries here gate the configuration prompt; other post_setup hooks (kittentts, piper, agent_browser, etc.) keep their existing behaviour. Adding"cua_driver": lambda: bool(shutil.which(_cua_driver_cmd()))._toolset_needs_configuration_prompt()extension — when any visible provider has a registered post_setup install-state check that hasn't been satisfied, force the configuration flow so_configure_providerinvokes_run_post_setupand the install actually runs.HERMES_CUA_DRIVER_CMDoverride threaded through — new_cua_driver_cmd()helper honours non-empty overrides (blank ones fall back to"cua-driver"). All call sites (install_cua_driver,_run_cua_driver_installer,_POST_SETUP_INSTALLEDpredicate) consult it. Tests pin the version-probe to the override so CI matches real-host behaviour.Validation
install_cua_driver().tests/hermes_cli/test_tools_config.py(78) +tests/hermes_cli/test_install_cua_driver.py(12 from fix(cli): pre-check CUA release asset for Intel macOS before install (#24530) #30168).178342791+sgtworkman@users.noreply.github.com → sgtworkmanto AUTHOR_MAP (separate follow-up commit).Credit @sgtworkman (PR #22776).
Closes #22776.
Infographic