fix(tui): clickable hyperlinks and skill slash command dispatch

Two TUI fixes:

1. Hyperlinks are now clickable (Cmd+Click / Ctrl+Click) in terminals
   that support OSC 8.  The markdown renderer was rendering links as
   plain colored text — now wraps them in the existing <Link> component
   from @hermes/ink which emits OSC 8 escape sequences.

2. Skill slash commands (e.g. /hermes-agent-dev) now work in the TUI.
   The slash.exec handler was delegating to the _SlashWorker subprocess
   which calls cli.process_command().  For skills, process_command()
   queues the invocation message onto _pending_input — a Queue that
   nobody reads in the worker subprocess.  The skill message was lost.
   Now slash.exec detects skill commands early and rejects them so
   the TUI falls through to command.dispatch, which correctly builds
   and returns the skill payload for the client to send().
This commit is contained in:
kshitijk4poor 2026-04-18 17:36:06 +05:30 committed by kshitij
parent b0efdf37d7
commit 2da558ec36
5 changed files with 106 additions and 9 deletions

View file

@ -2333,6 +2333,19 @@ def _(rid, params: dict) -> dict:
if not cmd:
return _err(rid, 4004, "empty command")
# Skill slash commands (e.g. /hermes-agent-dev) must NOT go through the
# slash worker — process_command() queues the skill payload onto
# _pending_input which nobody reads in the worker subprocess. Reject
# here so the TUI falls through to command.dispatch which handles skills
# correctly (builds the invocation message and returns it to the client).
try:
from agent.skill_commands import scan_skill_commands
_cmd_key = f"/{cmd.split()[0]}" if not cmd.startswith("/") else f"/{cmd.lstrip('/').split()[0]}"
if _cmd_key in scan_skill_commands():
return _err(rid, 4018, f"skill command: use command.dispatch for {_cmd_key}")
except Exception:
pass
worker = session.get("slash_worker")
if not worker:
try: