Skip to content

The agent that grows with you

fix(onboarding): should_run reads onboarding.run through the effective loader

alt-glitch9847039b0b09
diff --git a/hermes_cli/onboarding_run.py b/hermes_cli/onboarding_run.py
index 1ad99992948..1e09171f780 100644
--- a/hermes_cli/onboarding_run.py
+++ b/hermes_cli/onboarding_run.py
@@ -54,11 +54,12 @@ def _named_profiles(root: Path) -> list[Path]:
def should_run() -> bool:
- """The root file's explicit ``onboarding.run`` when it is a bool, else whether the install is fresh."""
- from hermes_cli.config import read_user_config_raw
+ """The root config's explicit ``onboarding.run`` (managed overlay included) when it is a bool,
+ else whether the install is fresh."""
+ from hermes_cli.config_effective import load_user_config_effective
- # Raw read on purpose: load_config() resolves the launch profile and fills the default None.
- section = read_user_config_raw(_root_config()).get("onboarding")
+ # Not load_config(): it resolves the launch profile and fills the default None for an unset flag.
+ section = load_user_config_effective(_root_config()).get("onboarding")
value = section.get("run") if isinstance(section, dict) else None
return value if isinstance(value, bool) else not install_has_history(get_default_hermes_root())
diff --git a/tests/hermes_cli/test_onboarding_run.py b/tests/hermes_cli/test_onboarding_run.py
index 3467568cd22..f2ed55451b0 100644
--- a/tests/hermes_cli/test_onboarding_run.py
+++ b/tests/hermes_cli/test_onboarding_run.py
@@ -59,6 +59,19 @@ def test_a_user_profile_is_history_but_a_setup_profile_is_not(root):
assert onboarding_run.should_run() is False
+def test_a_managed_run_false_wins_on_a_fresh_install(root, tmp_path, monkeypatch):
+ # IT can pin the questionnaire off through the managed overlay; the root file stays unset.
+ from hermes_cli import managed_scope
+
+ managed = tmp_path / "managed"
+ managed.mkdir()
+ (managed / "config.yaml").write_text("onboarding:\n run: false\n", encoding="utf-8")
+ monkeypatch.setenv("HERMES_MANAGED_DIR", str(managed))
+ managed_scope.invalidate_managed_cache()
+
+ assert onboarding_run.should_run() is False
+
+
def test_explicit_true_runs_despite_history(root):
_add_session(root)
onboarding_run.set_run(True)