The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(state): a reset or branch of the onboarding chat no longer copies its run
alt-glitcha1fa82fe3b1e
diff --git a/hermes_state_compression.py b/hermes_state_compression.pyindex b3e999dd66c..82f5cc121c6 100644--- a/hermes_state_compression.py+++ b/hermes_state_compression.py@@ -327,13 +327,13 @@ class SessionCompressionMixin:_insert_session_row's compression-fork backfill: the child stays on the parent's profile and keepsgateway routing/origin columns; no owner on either side -> this store's profile."""from hermes_state_sessions import _parse_model_config+ # Pin/archive and the conversation keys are compression-lineage state; canonical branch/reset+ # verbs also publish through here, and their child is its own conversation.+ continuation = not any(k in (model_config or {}) for k in ("_branched_from", "_reset_from"))carried = {key: value for key, value in _parse_model_config(parent["model_config"]).items()- if key in _CONVERSATION_MODEL_CONFIG_KEYS}+ if continuation and key in _CONVERSATION_MODEL_CONFIG_KEYS}model_config = {**carried, **(model_config or {})}system_prompt_hash = self._store_system_prompt(conn, system_prompt)- # Pin/archive are compression-lineage flags; canonical branch/reset verbs also publish through- # here, and their child is its own conversation, so it starts unpinned and visible.- continuation = not any(k in (model_config or {}) for k in ("_branched_from", "_reset_from"))# Copy a real creating surface. Automatic compression passes the parent's live# label (``local`` after the peer refresh); reset, branch and the compress# mutation pass the policy label. ``local`` and ``unknown`` are not surfaces,diff --git a/tests/gateway/test_onboarding_reset.py b/tests/gateway/test_onboarding_reset.pynew file mode 100644index 00000000000..62f933bd4f5--- /dev/null+++ b/tests/gateway/test_onboarding_reset.py@@ -0,0 +1,46 @@+"""``/new`` (a canonical reset) inside the onboarding chat, then Skip setup: the run ends and the install+stops being mid-onboarding. The reset child is its own conversation, so it carries no copy of the run+that Skip (which names the chat's logical id) could never reach.+"""+from __future__ import annotations++import pytest++from tests.gateway.test_onboarding_on_the_authority import _desktop, _request, _settled+from tests.waiting import async_wait_until+++async def _mutate(desktop, rid, stored, operation):+ """One revision-fenced ``session.mutate``; resent on a revision conflict as the Desktop does."""+ for attempt in range(5):+ row = desktop.db.get_session(stored)+ reply = await _request(desktop, rid * 10 + attempt, "session.mutate", {+ "session_id": stored, "request_id": f"{operation}-{rid}-{attempt}", "operation": operation,+ "expected_revision": row["runtime_revision"], "expected_generation": row["runtime_generation"],+ "payload": {}})+ if "result" in reply or reply.get("error", {}).get("data", {}).get("reason") != "revision_conflict":+ return reply+ return reply+++async def test_skip_after_new_in_the_onboarding_chat_ends_the_run(tmp_path, monkeypatch):+ from agent.onboarding_record import open_session_ids+ from hermes_cli.config import read_user_config_raw+ from hermes_cli.onboarding_run import _root_config+ turns = []+ desktop = await _desktop(tmp_path, monkeypatch, turns)+ try:+ stored = (await _request(desktop, 1, "onboarding.start", {"rerun": True}))["result"]["stored_session_id"]+ await async_wait_until(lambda: turns, timeout=10)+ await _settled(desktop, stored)++ reset = await _mutate(desktop, 2, stored, "reset")+ assert "result" in reset, reset+ skipped = await _request(desktop, 3, "onboarding.skip", {"session_id": stored})++ assert skipped.get("result") == {"skipped": True}, skipped+ assert open_session_ids(desktop.db) == []+ assert read_user_config_raw(_root_config())["onboarding"]["run"] is False+ finally:+ await desktop.connection.close()