fix(tools): use display_hermes_home() in cron script validation error messages - #38695
Open
goktug7913 wants to merge 1 commit into
Open
goktug7913 wants to merge 1 commit into
goktug7913 wants to merge 1 commit into
Conversation
… messages Hardcoded ~/.hermes/scripts/ references in _validate_cron_script_path gave misleading guidance when HERMES_HOME points to a non-default location (e.g. /opt/data in Docker). display_hermes_home() already existed for exactly this purpose and was already used in the schema description for this same tool (line 795). Added a regression test that sets HERMES_HOME to a temp path and asserts the error message reflects the configured path, not the default. Fixes NousResearch#38693
This was referenced Jun 24, 2026
Collaborator
|
Thanks for the focused regression fix. Current main still has the incorrect hardcoded guidance at This is an automated hermes-sweeper review. |
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 changed and why
_validate_cron_script_pathintools/cronjob_tools.pycorrectly resolves the scripts directory viaget_hermes_home() / "scripts"at runtime, but the error messages it returns hardcoded~/.hermes/scripts/. WhenHERMES_HOMEpoints to a non-default location (e.g./opt/datain Docker), users received misleading guidance directing them to the wrong directory.The fix replaces the hardcoded string with
display_hermes_home(), which already existed for exactly this purpose — its docstring says "Use this in user-facing print/log messages instead of hardcoding~/.hermes" — and was already used in the schema description on line 795 of the same file.Changes
tools/cronjob_tools.py: replaced hardcoded~/.hermes/scripts/withf"{display_hermes_home()}/scripts"in the two error message lines inside_validate_cron_script_pathtests/cron/test_cron_script.py: addedtest_absolute_path_error_references_actual_hermes_homeregression test that setsHERMES_HOMEto a temp path and asserts the error message reflects the configured path, not the default~/.hermesHow to test
HERMES_HOME=/tmp/custom-homeand attempt to create a cron job withscript="/tmp/evil.py"— the error should reference/tmp/custom-home/scripts/, not~/.hermes/scripts/.pytest tests/cron/test_cron_script.py::TestCronjobToolScriptValidation -v— all 8 tests should pass.Platforms tested
Fixes #38693