Skip to content

fix(skills): render inline shell in skill_view - #15376

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-017f8f83
Apr 24, 2026
Merged

teknium1 merged 2 commits into
mainfrom
hermes/hermes-017f8f83

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Salvage of #15306 by @helix4u — cherry-picked onto current main with one follow-up fix.

Summary

Skills loaded through the skill_view tool now honor skills.inline_shell and skills.template_vars the same way the slash/preload path already did. Previously !\cmd`snippets and${HERMES_SKILL_DIR}tokens came back raw fromskill_view, and the model had to separately call terminal` to realize the shell value.

Reported by a user in Discord — config had skills.inline_shell: true but !\date -u +%Y-%m-%d`` reached the model unrendered.

Changes

  • agent/skill_preprocessing.py (new): shared preprocess_skill_content() / expand_inline_shell() / substitute_template_vars() / load_skills_config()
  • agent/skill_commands.py: imports helpers from the shared module; slash/preload path calls skill_view(preprocess=False) and renders the skill message itself as before
  • tools/skills_tool.py: skill_view() applies preprocessing by default on both the main skill path and _serve_plugin_skill; new preprocess: bool = True parameter for internal callers
  • Follow-up on top of @helix4u's commit: dropped the raw_content field from the skill_view JSON response. It went to the model verbatim and duplicated the SKILL.md body on every tool call; the slash/preload caller falls back to content when raw_content is absent (and passes preprocess=False anyway), so nothing downstream needs it.

Validation

E2E with the reporter's exact skill + config (inline_shell: true):

  • Before: content ends in Current date: !\date -u +%Y-%m-%d`` (literal)
  • After: content ends in Current date: 2026-04-24 (rendered)
  • raw_content not present in response (no duplicated payload)

Targeted tests: scripts/run_tests.sh tests/tools/test_skills_tool.py tests/agent/test_skill_commands.py → 114/114 passed.

Closes #15306.

helix4u and others added 2 commits April 24, 2026 15:08
skill_view response went to the model verbatim; duplicating the SKILL.md
body as raw_content on every tool call added token cost with no agent-facing
benefit. Remove the field and update tests to assert on content only.

The slash/preload caller (agent/skill_commands.py) already falls back to
content when raw_content is absent, and it calls skill_view(preprocess=False)
anyway, so content is already unrendered on that path.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ npm lockfile hash out of date

Checked against commit b6b088d (PR head at check time).

The hash = "sha256-..." line in these nix files no longer matches the committed package-lock.json:

Apply the fix

  • Apply lockfile fix — tick to push a commit with the correct hashes to this PR branch
  • Or run the Nix Lockfile Fix workflow manually (pass PR #15376)
  • Or locally: nix run .#fix-lockfiles -- --apply and commit the diff

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/skills Skills system (list, view, manage) labels Apr 24, 2026
@teknium1
teknium1 merged commit 2de8a7a into main Apr 24, 2026
8 of 12 checks passed
@teknium1
teknium1 deleted the hermes/hermes-017f8f83 branch April 24, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants