{"repo":"NousResearch/hermes-agent","public_id":"51829","display_label":"Routing /learn slash command through dispatch layers","summary":"These issues and PRs concern a /learn slash command feature and the bugs around correctly routing it through command dispatch in TUI and Desktop GUI so that it actually triggers the LLM. Multiple fixes address the same underlying dispatch/routing gap across different interfaces.","subsystem":null,"counts":{"members":6,"open_issues":0,"open_issues_distinct":0,"open_prs":0,"closed_issues":1,"merged_prs":1,"attempt_prs":4},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":52232},"resolution":{"state":"resolved","by":"pr-52232"},"freshness":{"state":"verified","last_verified_at":"2026-06-25T01:48:50+00:00","is_stale":false},"grouping":{"backbone":"STRUCTURAL_SPANNING","link_density":0.3333333333333333},"fix_edges":[{"issue_number":51829,"pr_number":52232,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true}],"members":[{"kind":"issue","number":51829,"title":"/learn slash command shows ack message but does not trigger LLM in Desktop GUI","url":null,"state":"closed"},{"kind":"pr","number":51840,"title":"fix(tui): add /learn to _PENDING_INPUT_COMMANDS so Desktop GUI submits the learn prompt","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51638","number":51638}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":52052,"title":"fix(desktop): route /learn into the agent turn","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51840","number":51840},{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51829","number":51829}],"category":"duplicate_of","implication":"duplicate"},"merged":false},{"kind":"pr","number":52123,"title":"fix(tui): route /learn through command.dispatch in Desktop GUI","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#51638","number":51638}],"category":"implemented_elsewhere","implication":"superseded"},"merged":false},{"kind":"pr","number":52232,"title":"fix(tui): route /learn through command.dispatch so the prompt fires (#51829)","url":null,"state":"merged","close_reason":{"category":"merged","implication":"superseded"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["tests/tui_gateway/test_protocol.py","tui_gateway/server.py"],"fix_hunks":[{"file":"tests/tui_gateway/test_protocol.py","hunks":["@@ -1214,7 +1214,7 @@ def handler(arg):\n     assert worker.calls == []\n \n \n[redacted:email](\"cmd\", [\"retry\", \"queue hello\", \"q hello\", \"steer fix the test\", \"plan\"])\n[redacted:email](\"cmd\", [\"retry\", \"queue hello\", \"q hello\", \"steer fix the test\", \"plan\", \"learn create a skill from https://example.com/docs\"])\n def test_slash_exec_routes_pending_input_commands_to_dispatch(server, cmd):\n     \"\"\"slash.exec must route _pending_input commands to command.dispatch\n     internally instead of returning the old 4018 \"use command.dispatch\"","@@ -1288,6 +1288,38 @@ def test_command_dispatch_queue_requires_arg(server):\n     assert resp[\"error\"][\"code\"] == 4004\n \n \n+def test_command_dispatch_learn_sends_built_prompt(server):\n+    \"\"\"command.dispatch /learn returns {type: 'send', message: <built prompt>}\n+    so the TUI fires a real agent turn (#51829). The CLI handler queues onto\n+    _pending_input — a queue the TUI slash worker has no reader for — so the\n+    prompt was silently dropped after the ack. Routing through command.dispatch\n+    injects the standards-guided prompt as a normal turn instead.\n+    \"\"\"\n+    from agent.learn_prompt import build_learn_prompt\n+\n+    sid = \"test-session\"\n+    server._sessions[sid] = {\"session_key\": sid}\n+\n+    arg = \"create a skill from https://example.com/docs\"\n+    resp = server.handle_request({\n+        \"id\": \"r-learn\",\n+        \"method\": \"command.dispatch\",\n+        \"params\": {\"name\": \"learn\", \"arg\": arg, \"session_id\": sid},\n+    })\n+\n+    assert \"error\" not in resp\n+    result = resp[\"result\"]\n+    assert result[\"type\"] == \"send\"\n+    assert result[\"message\"] == build_learn_prompt(arg)\n+\n+\n+def test_pending_input_commands_includes_learn(server):\n+    \"\"\"Guard: _PENDING_INPUT_COMMANDS must list 'learn' — without it slash.exec\n+    routes /learn to the slash worker, which only prints the ack and drops the\n+    prompt onto the dead _pending_input queue (#51829).\"\"\"\n+    assert \"learn\" in server._PENDING_INPUT_COMMANDS\n+\n+\n def test_skills_manage_search_uses_tools_hub_sources(server):\n     result = type(\"Result\", (), {\n         \"description\": \"Build better terminal demos\","]},{"file":"tui_gateway/server.py","hunks":["@@ -9885,6 +9885,7 @@ def _(rid, params: dict) -> dict:\n         \"plan\",\n         \"goal\",\n         \"undo\",\n+        \"learn\",\n     }\n )\n \n"]}]},{"kind":"pr","number":52817,"title":"fix(tui): route /learn through command.dispatch in TUI gateway","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#51638","number":51638},{"kind":"pr","value":"#52232","number":52232}],"category":"implemented_elsewhere","implication":"superseded"},"merged":false}],"trust":{"default_tier":"verified","includes_suggested":false}}