Skip to content

fix(doctor): cronjob always shows 'system dependency not met' - #884

Closed
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/doctor-cronjob-false-system-dependency
Closed

fix(doctor): cronjob always shows 'system dependency not met'#884
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/doctor-cronjob-false-system-dependency

Conversation

@ygd58

@ygd58 ygd58 commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #878

hermes doctor always showed ⚠ cronjob (system dependency not met) even on fully working installations.

Root Cause

check_cronjob_requirements() gates on HERMES_INTERACTIVE (and two other env vars) that are set by the CLI at startup — but hermes doctor never sets them. So the check always returns False.

The env-var gate is correct for runtime: cronjob tools only make sense in an interactive or gateway session. The bug is that the doctor check runs without that context.

Fix

Temporarily set HERMES_INTERACTIVE=1 for the duration of check_tool_availability() in doctor, then restore the original env state. One line of change in the right place — no changes to the tool's own logic.

This is safer than modifying check_cronjob_requirements() itself, which would affect runtime gating behavior.

Before:

@ygd58
ygd58 force-pushed the fix/doctor-cronjob-false-system-dependency branch from ee150de to 8790ba8 Compare March 11, 2026 01:07
@ygd58
ygd58 force-pushed the fix/doctor-cronjob-false-system-dependency branch from 8790ba8 to 78b1b71 Compare March 11, 2026 09:38
Tools that gate on runtime mode (e.g. cronjob) check for env vars like
HERMES_INTERACTIVE that are only set when the CLI is running normally.
During 'hermes doctor' these vars are absent, so cronjob always showed
'(system dependency not met)' even on fully working installations.

Fix: temporarily set HERMES_INTERACTIVE=1 for the duration of the
check_tool_availability() call, then restore the original env state.
This reflects the actual runtime context under which the tools operate.

Fixes NousResearch#878
@ygd58
ygd58 force-pushed the fix/doctor-cronjob-false-system-dependency branch from 78b1b71 to c26ab61 Compare March 12, 2026 13:01
@ygd58

ygd58 commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

Both #884 and #895 use the same os.environ.setdefault("HERMES_INTERACTIVE", "1") approach. Differences:

  • This PR uses setdefault scoped to run_doctor() so it applies for the entire doctor session, not just the tool-availability check avoids the case where a later check also needs the var set
  • This PR has 2 tests: one verifying the fix itself, one verifying setdefault doesn't override an existing HERMES_INTERACTIVE value (important for callers that already set it)
  • This PR is rebased on latest main (as of today), no conflicts

Happy to close in favour of #895 if preferred just flagging the test coverage difference.

@ygd58

ygd58 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

Closing — this fix was independently implemented in upstream main (hermes_cli/doctor.py line 102). The approach is identical: os.environ.setdefault("HERMES_INTERACTIVE", "1") in run_doctor(). Issue #878 is resolved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes doctor always reports the cronjob tool as "(system dependency not met)"

1 participant