Skip to content

The agent that grows with you

refactor(update): share command-boundary receipt reason

tachyon-r6e0fba4e5898
diff --git a/hermes_cli/main.py b/hermes_cli/main.py
index 6cb431dae7b..8c733250677 100644
--- a/hermes_cli/main.py
+++ b/hermes_cli/main.py
@@ -2279,7 +2279,9 @@ def cmd_update(args):
_finalize_update_receipt(1, f"{type(_update_exc).__name__}: {_update_exc}")
raise
else:
- _finalize_update_receipt(0, "completed at command boundary")
+ from hermes_cli.update_receipt import COMMAND_BOUNDARY_STOP_REASON
+
+ _finalize_update_receipt(0, COMMAND_BOUNDARY_STOP_REASON)
_update_handoff_exit_code = 0
finally:
_update_lock.release()
diff --git a/hermes_cli/update_receipt.py b/hermes_cli/update_receipt.py
index 1a4fecabab8..85135e712a0 100644
--- a/hermes_cli/update_receipt.py
+++ b/hermes_cli/update_receipt.py
@@ -19,6 +19,7 @@ from typing import Any, Optional
logger = logging.getLogger(__name__)
_RECEIPT_KEEP = 20 # keep the last N receipts per profile home
+COMMAND_BOUNDARY_STOP_REASON = "completed at command boundary"
# ``hermes update`` is a single-threaded CLI command; a module singleton lets the 7k-line updater
# record steps from any depth without threading a handle through every helper.
diff --git a/tests/hermes_cli/test_update_fleet_restart_pending.py b/tests/hermes_cli/test_update_fleet_restart_pending.py
index 49fcf3705b4..c099f992c97 100644
--- a/tests/hermes_cli/test_update_fleet_restart_pending.py
+++ b/tests/hermes_cli/test_update_fleet_restart_pending.py
@@ -27,6 +27,7 @@ import hermes_cli.main_install_repair as main_install_repair
from hermes_cli import update_cmd
import hermes_cli.update_cmd_fleet as update_cmd_fleet
import hermes_cli.update_cmd_deps as update_cmd_deps
+from hermes_cli.update_receipt import COMMAND_BOUNDARY_STOP_REASON
from hermes_constants import get_hermes_home
@@ -270,7 +271,7 @@ def test_successful_command_boundary_receipt_without_fleet_does_not_retrigger(
{
"exit_code": 0,
"outcome": "success",
- "stop_reason": "completed at command boundary",
+ "stop_reason": COMMAND_BOUNDARY_STOP_REASON,
"plan": {
"expected_sha": old_sha,
"runtimes": [