Skip to content

The agent that grows with you

fix(onboarding): the task chat setup hands off to gets no first-message offer

alt-glitcha175ddfeb45c
diff --git a/agent/onboarding.py b/agent/onboarding.py
index 57fb6604560..afd0370afe1 100644
--- a/agent/onboarding.py
+++ b/agent/onboarding.py
@@ -168,11 +168,15 @@ def first_contact_turn_note(
return the plain intro note. Returns ``None`` when this is not the first
contact (non-empty session history or prior sessions exist on the install).
"""
+ from agent.first_task_prompt import MARKER as FIRST_TASK_MARKER
from agent.initiate_setup_prompt import HEADER
from hermes_cli.profiles import SETUP_PROFILE_MARKER
if not session_history_empty or install_has_prior_sessions or message.startswith(HEADER):
return None
+ # The task chat setup hands off to is the user's first chat in their own profile; setup already ran.
+ if FIRST_TASK_MARKER in message:
+ return None
# The setup chat opens with its own welcome, whatever its first message says.
if (config_path.parent / SETUP_PROFILE_MARKER).is_file():
return None
diff --git a/tests/agent/test_onboarding.py b/tests/agent/test_onboarding.py
index ce757ff8908..b9ca8422d51 100644
--- a/tests/agent/test_onboarding.py
+++ b/tests/agent/test_onboarding.py
@@ -142,6 +142,24 @@ class TestFirstContactTurnNote:
)
assert TASK_FIRST_CLAUSE in note, mode
+ def test_no_note_in_the_task_chat_setup_hands_off_to(self, tmp_path, monkeypatch):
+ # The first-task chat is the first chat in the user's own profile, but setup already ran:
+ # no setup offer, no intro, and the offer latch stays unset.
+ from agent.first_task_prompt import MARKER
+ from agent.onboarding import PROFILE_BUILD_FLAG, first_contact_turn_note
+
+ monkeypatch.setenv("HERMES_GUEST_ONBOARDING", "1")
+ cfg_path = tmp_path / "config.yaml"
+ note = first_contact_turn_note(
+ {"onboarding": {"profile_build": "ask"}},
+ cfg_path,
+ session_history_empty=True,
+ install_has_prior_sessions=False,
+ message=f"Set up Blender for me{MARKER}skill text",
+ )
+ assert note is None
+ assert not cfg_path.exists() or PROFILE_BUILD_FLAG not in cfg_path.read_text()
+
def test_returns_none_when_not_first_contact(self, tmp_path):
from agent.onboarding import first_contact_turn_note