# NousResearch/hermes-agent · Routing /learn slash command through dispatch layers

## Open now

- Nothing open on GitHub.

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.

## TL;DR

- 6 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 4 PR(s) closed without merging.
- A fix was merged to main in PR #52232. Verify it addresses your case.
- **Recommended:** read PR #52232 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-52232`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.33`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #51829: /learn slash command shows ack message but does not trigger LLM in Desktop GUI

## Prior & competing PRs

- **#52232: fix(tui): route /learn through command.dispatch so the prompt fires (#51829)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `tests/tui_gateway/test_protocol.py`, `tui_gateway/server.py`
  - fix hunks:
  - `tests/tui_gateway/test_protocol.py`

    ```diff
    @@ -1214,7 +1214,7 @@ def handler(arg):
         assert worker.calls == []
     
     
    [redacted:email]("cmd", ["retry", "queue hello", "q hello", "steer fix the test", "plan"])
    [redacted:email]("cmd", ["retry", "queue hello", "q hello", "steer fix the test", "plan", "learn create a skill from https://example.com/docs"])
     def test_slash_exec_routes_pending_input_commands_to_dispatch(server, cmd):
         """slash.exec must route _pending_input commands to command.dispatch
         internally instead of returning the old 4018 "use command.dispatch"
    ```

    ```diff
    @@ -1288,6 +1288,38 @@ def test_command_dispatch_queue_requires_arg(server):
         assert resp["error"]["code"] == 4004
     
     
    +def test_command_dispatch_learn_sends_built_prompt(server):
    +    """command.dispatch /learn returns {type: 'send', message: <built prompt>}
    +    so the TUI fires a real agent turn (#51829). The CLI handler queues onto
    +    _pending_input — a queue the TUI slash worker has no reader for — so the
    +    prompt was silently dropped after the ack. Routing through command.dispatch
    +    injects the standards-guided prompt as a normal turn instead.
    +    """
    +    from agent.learn_prompt import build_learn_prompt
    +
    +    sid = "test-session"
    +    server._sessions[sid] = {"session_key": sid}
    +
    +    arg = "create a skill from https://example.com/docs"
    +    resp = server.handle_request({
    +        "id": "r-learn",
    +        "method": "command.dispatch",
    +        "params": {"name": "learn", "arg": arg, "session_id": sid},
    +    })
    +
    +    assert "error" not in resp
    +    result = resp["result"]
    +    assert result["type"] == "send"
    +    assert result["message"] == build_learn_prompt(arg)
    +
    +
    +def test_pending_input_commands_includes_learn(server):
    +    """Guard: _PENDING_INPUT_COMMANDS must list 'learn' — without it slash.exec
    +    routes /learn to the slash worker, which only prints the ack and drops the
    +    prompt onto the dead _pending_input queue (#51829)."""
    +    assert "learn" in server._PENDING_INPUT_COMMANDS
    +
    +
     def test_skills_manage_search_uses_tools_hub_sources(server):
         result = type("Result", (), {
             "description": "Build better terminal demos",
    ```
  - `tui_gateway/server.py`

    ```diff
    @@ -9885,6 +9885,7 @@ def _(rid, params: dict) -> dict:
             "plan",
             "goal",
             "undo",
    +        "learn",
         }
     )
     
    ```
- **#51840: fix(tui): add /learn to _PENDING_INPUT_COMMANDS so Desktop GUI submits the learn prompt**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#51638`, `#51638`
- **#52052: fix(desktop): route /learn into the agent turn**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#51638`, `#51638`, `#51840`, `#51638`, `#51829`
- **#52123: fix(tui): route /learn through command.dispatch in Desktop GUI**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#51638`, `#51638`, `#51638`
- **#52817: fix(tui): route /learn through command.dispatch in TUI gateway**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#51638`, `#52232`

## Fix status

- Merged to main in PR #52232 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-06-25`.
