Skip to content

feat: expose skills RPCs - #19168

Open
hankbobtheresearchoor wants to merge 1 commit into
NousResearch:mainfrom
hankbobtheresearchoor:feat/skills-rpc
Open

feat: expose skills RPCs#19168
hankbobtheresearchoor wants to merge 1 commit into
NousResearch:mainfrom
hankbobtheresearchoor:feat/skills-rpc

Conversation

@hankbobtheresearchoor

Copy link
Copy Markdown

Summary

Exposes Hermes Agent skills over the TUI/API-server JSON-RPC transport for native clients.

  • add skills.list, skills.tree, skills.get, skills.graph, and skills.update
  • read skills from $HERMES_HOME/skills plus configured external skill dirs
  • mark external skill roots read-only
  • validate SKILL.md frontmatter before writes
  • emit skills.changed after update

Validation

  • python3 -m py_compile tui_gateway/server.py
  • focused RPC smoke test for:
    • skills.list
    • skills.tree
    • skills.graph
    • skills.get
    • skills.update

Notes

Companion HermesNative PR adds the UI that consumes these RPCs.

@alt-glitch alt-glitch added comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/feature New feature or request labels May 3, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for exposing a useful native-client surface. The exact five RPCs are not present on current main, so the capability remains relevant, but this implementation needs to align with current skill infrastructure.

Problems

  • tui_gateway/server.py:3973 captures module-level SKILLS_DIR; current main uses call-time resolution for multi-profile TUI/Desktop backends (tools/skill_manager_tool.py:156-168, c6a3d412d).
  • tui_gateway/server.py:3975 makes all external roots read-only, contrary to the documented foreground-edit behavior for writable skills.external_dirs (website/docs/user-guide/features/skills.md:325-328).
  • tui_gateway/server.py:4201-4202 bypasses the manager write path and does not clear the skills prompt snapshot; the dashboard delegates to _edit_skill then invalidates that cache (hermes_cli/web_server.py:13267-13279).
  • The recursive scan RPCs are not in _LONG_HANDLERS, so they run inline via dispatch() (tui_gateway/server.py:1254-1290).

Suggested changes

  • Reuse the canonical skill manager and call-time profile-scoped root resolution.
  • Preserve writable external directories for foreground edits.
  • Pool scan RPCs and add protocol tests for profile, external-root, and update/cache behavior.

Automated hermes-sweeper review.

Comment thread tui_gateway/server.py
from agent.skill_utils import get_external_skills_dirs
from tools.skills_tool import SKILLS_DIR

roots: list[tuple[Path, str, bool]] = [(Path(SKILLS_DIR), "local", True)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not capture SKILLS_DIR here. Current main resolved this bug class by using the active HERMES_HOME at call time for long-lived TUI/Desktop backends (tools/skill_manager_tool.py:156-168, c6a3d412d); this local root can otherwise target the launch profile rather than the active profile.

Comment thread tui_gateway/server.py

roots: list[tuple[Path, str, bool]] = [(Path(SKILLS_DIR), "local", True)]
for idx, root in enumerate(get_external_skills_dirs()):
roots.append((Path(root), f"external:{idx}", False))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking every external root read-only changes the current foreground-edit contract. website/docs/user-guide/features/skills.md:325-328 documents in-place updates for writable skills.external_dirs; only autonomous curation treats those roots as read-only.

Comment thread tui_gateway/server.py
_validate_skill_content(content)
target = skill_dir / "SKILL.md"
tmp = target.with_suffix(".md.tmp")
tmp.write_text(content, encoding="utf-8")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Route this through the canonical skill-manager rewrite path instead of writing directly. Current dashboard updates use _edit_skill and clear the skills prompt cache afterward (hermes_cli/web_server.py:13267-13279); this direct write omits those established behaviors.

Comment thread tui_gateway/server.py
raise ValueError("skill description must be <= 1024 characters")


@method("skills.list")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These root-scanning RPCs need registration in _LONG_HANDLERS; otherwise dispatch() runs them on the reader thread. Current main specifically pools skills.manage to prevent skill scans and network-backed actions from stalling inbound TUI RPCs.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/skills Skills system (list, view, manage) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants