Skip to content

The agent that grows with you

fix(cli): map --source desktop on resume too

unsupportedpastels783f14d043d5
diff --git a/hermes_cli/gateway_chat.py b/hermes_cli/gateway_chat.py
index dc1bfab3b72..55555a8f529 100644
--- a/hermes_cli/gateway_chat.py
+++ b/hermes_cli/gateway_chat.py
@@ -291,7 +291,8 @@ def _requested_policy(args):
if not policy["skills"]:
policy.pop("skills")
if getattr(args, "source", None):
- policy["source"] = args.source
+ from agent.session_source import create_surface
+ policy["source"] = create_surface(args.source)
return policy
diff --git a/tests/hermes_cli/test_gateway_chat.py b/tests/hermes_cli/test_gateway_chat.py
index 2815671315f..f608d112777 100644
--- a/tests/hermes_cli/test_gateway_chat.py
+++ b/tests/hermes_cli/test_gateway_chat.py
@@ -31,6 +31,13 @@ def test_unsupported_launch_options_fail_before_connection(monkeypatch, capsys):
assert calls == []
+def test_resume_repeating_source_desktop_matches_the_stored_gui_session():
+ """`--source desktop` creates as `gui`; repeating it on `--resume` is the same session source."""
+ from hermes_cli import gateway_chat
+ frozen = {"info": {"launch_request": {"source": "gui"}}}
+ gateway_chat.check_resume_policy(argparse.Namespace(resume="stored", source="desktop", query="x"), frozen)
+
+
def test_refusals_name_the_replacement_and_a_runnable_safe_mode_example(monkeypatch, capsys):
"""An exit-2 refusal tells the user where every refused flag went; the safe-mode
refusal prints a command they can run as-is."""