The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cli): keep stacked plugin skills working on the interactive CLI path
Hermes Agent0319b1505dc4
diff --git a/cli.py b/cli.pyindex 9fa8229b400..5813b28da29 100644--- a/cli.py+++ b/cli.py@@ -1326,7 +1326,9 @@ class HermesCLI(CLIInitMixin, CLITuiRuntimeMixin, CLIProcessNotificationsMixin,"""``/<skill> ...``; stacked ``/skill-a /skill-b do XYZ`` loads every leading skill (up to 5)."""from agent.skill_commands import build_stacked_skill_invocation_message, split_stacked_skill_commands- extra_keys, user_instruction = split_stacked_skill_commands(rest)+ # Interactive surface: stacked tokens resolve against the interactive+ # map so plugin skills stack in the CLI like native skills.+ extra_keys, user_instruction = split_stacked_skill_commands(rest, interactive=True)if extra_keys:stacked_result = build_stacked_skill_invocation_message([base_cmd, *extra_keys], user_instruction, task_id=self.session_id,diff --git a/tests/agent/test_plugin_skill_boundary.py b/tests/agent/test_plugin_skill_boundary.pyindex 49db2f46b55..50abe0f4d4b 100644--- a/tests/agent/test_plugin_skill_boundary.py+++ b/tests/agent/test_plugin_skill_boundary.py@@ -13,6 +13,7 @@ may resolve a ``/plugin:skill`` token."""import json+import queuefrom pathlib import Pathfrom unittest.mock import patch@@ -157,8 +158,38 @@ class TestNativeStackedBoundary:def test_stacked_loader_defaults_to_interactive_table(self, plugin_home):"""CLI/TUI callers keep the interactive default: a plugin skill loads."""import agent.skill_commands as sc-_make_plugin_skill(plugin_home, "boundary-probe", "guide", "Plugin body.")result = sc.build_stacked_skill_invocation_message(["/boundary-probe:guide"], "go")assert result is not Noneassert result[1] == ["boundary-probe:guide"]++ def test_cli_run_skill_slash_command_stacks_plugin_skill(self, plugin_home, capsys):+ """The CLI is an interactive surface: ``/<local> /<plugin:skill> do it``+ must load BOTH bodies. Guards against the regression where the stacked+ token scan silently fell back to the native map in the CLI path."""+ import agent.skill_commands as sc+ from cli import HermesCLI++ _make_plugin_skill(plugin_home, "cli-stack-probe", "guide", "CLI-PLUGIN-BODY.")+ local = plugin_home / "skills" / "local-skill" / "SKILL.md"+ local.parent.mkdir(parents=True, exist_ok=True)+ local.write_text("---\nname: local-skill\ndescription: Local.\n---\nLOCAL-BODY.\n")+ commands = sc.get_interactive_skill_commands()+ assert "/cli-stack-probe:guide" in commands+ assert "/local-skill" in commands++ class _ReplStub(HermesCLI):+ def __init__(self) -> None: # skip the real REPL boot+ self.session_id = "test-session"+ self._pending_input = queue.Queue()++ repl = _ReplStub.__new__(_ReplStub)+ repl.session_id = "test-session"+ repl._pending_input = queue.Queue()+ repl._run_skill_slash_command(+ "/local-skill", commands["/local-skill"], "/cli-stack-probe:guide do the thing",+ )+ out = capsys.readouterr().out+ assert "⚡" in out # stacked load label printed+ msg = repl._pending_input.get(timeout=1)+ assert "LOCAL-BODY." in msg and "CLI-PLUGIN-BODY." in msg