diff --git a/agent/initiate_setup_prompt.py b/agent/initiate_setup_prompt.py index 24aaea9622..d9852caef6 100644 --- a/agent/initiate_setup_prompt.py +++ b/agent/initiate_setup_prompt.py @@ -24,11 +24,12 @@ def build_initiate_setup_prompt(surface: str, tools, primary_profile: str, sessi """The skill, then one JSON block of facts the model reads as they are. ``session_id``: the desktop session the turn runs in; its ``setup_choose`` cards read the same facts.""" from hermes_cli.anon_auth import free_tier_route - from hermes_cli.setup_profile import read_state, record_cards + from hermes_cli.setup_profile import read_cards, read_state, record_cards host = initiate_setup_facts.facts() if session_id: - record_cards(session_id, initiate_setup_facts.setup_cards(host)) + # Kickoff re-sends the command into a stalled chat: keep the picks already recorded there. + record_cards(session_id, {**read_cards(session_id), **initiate_setup_facts.setup_cards(host)}) block = { "surface": surface, "tools_present": sorted(set(tools)), diff --git a/hermes_cli/setup_profile.py b/hermes_cli/setup_profile.py index 77bb7e81d0..4070e92c14 100644 --- a/hermes_cli/setup_profile.py +++ b/hermes_cli/setup_profile.py @@ -88,12 +88,15 @@ def ensure_setup_profile() -> SetupProfile: return SetupProfile(name, path, created=True) -def reset_setup_profile() -> SetupProfile: +def reset_setup_profile(launch_home: Path) -> SetupProfile: found = find_setup_profile() if found is None: raise LookupError("no setup profile to reset") name, path = found + # Reset can run on the setup profile's own backend; its skills then come from the launch profile. source = get_hermes_home() + if (source / profiles_mod.SETUP_PROFILE_MARKER).is_file(): + source = launch_home _write_soul(path) _replace_dir(path / "memories") _write_setup_config(path) diff --git a/tui_gateway/methods_onboarding.py b/tui_gateway/methods_onboarding.py index 88466bf269..169aedf95f 100644 --- a/tui_gateway/methods_onboarding.py +++ b/tui_gateway/methods_onboarding.py @@ -75,7 +75,7 @@ def _(rid, params: dict) -> dict: return _err(rid, 4072, "no setup profile to reset") _clear_setup_sessions(found[1]) try: - setup = reset_setup_profile() + setup = reset_setup_profile(_launch_home()) except Exception as e: return _err(rid, 5074, str(e)) return _ok(rid, {"name": setup.name, "path": str(setup.path), "reset": True})