fix(skills): render inline shell in skill_view - #15376
Merged
Merged
Conversation
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.
Contributor
|
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #15306 by @helix4u — cherry-picked onto current main with one follow-up fix.
Summary
Skills loaded through the
skill_viewtool now honorskills.inline_shellandskills.template_varsthe 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 callterminal` to realize the shell value.Reported by a user in Discord — config had
skills.inline_shell: truebut!\date -u +%Y-%m-%d`` reached the model unrendered.Changes
agent/skill_preprocessing.py(new): sharedpreprocess_skill_content()/expand_inline_shell()/substitute_template_vars()/load_skills_config()agent/skill_commands.py: imports helpers from the shared module; slash/preload path callsskill_view(preprocess=False)and renders the skill message itself as beforetools/skills_tool.py:skill_view()applies preprocessing by default on both the main skill path and_serve_plugin_skill; newpreprocess: bool = Trueparameter for internal callersraw_contentfield from theskill_viewJSON response. It went to the model verbatim and duplicated the SKILL.md body on every tool call; the slash/preload caller falls back tocontentwhenraw_contentis absent (and passespreprocess=Falseanyway), so nothing downstream needs it.Validation
E2E with the reporter's exact skill + config (
inline_shell: true):contentends inCurrent date: !\date -u +%Y-%m-%d`` (literal)contentends inCurrent date: 2026-04-24(rendered)raw_contentnot 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.