mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
fix(skills): drop raw_content to avoid doubling skill payload
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.
This commit is contained in:
parent
ead66f0c92
commit
2de8a7a229
2 changed files with 1 additions and 4 deletions
|
|
@ -365,7 +365,7 @@ class TestSkillView:
|
||||||
result = json.loads(raw)
|
result = json.loads(raw)
|
||||||
assert result["success"] is True
|
assert result["success"] is True
|
||||||
assert f"Run {skill_dir}/scripts/do.sh in session-123" in result["content"]
|
assert f"Run {skill_dir}/scripts/do.sh in session-123" in result["content"]
|
||||||
assert "${HERMES_SKILL_DIR}" in result["raw_content"]
|
assert "${HERMES_SKILL_DIR}" not in result["content"]
|
||||||
|
|
||||||
def test_skill_view_applies_inline_shell_when_enabled(self, tmp_path):
|
def test_skill_view_applies_inline_shell_when_enabled(self, tmp_path):
|
||||||
with (
|
with (
|
||||||
|
|
@ -390,7 +390,6 @@ class TestSkillView:
|
||||||
assert result["success"] is True
|
assert result["success"] is True
|
||||||
assert "Current date: 2026-04-24" in result["content"]
|
assert "Current date: 2026-04-24" in result["content"]
|
||||||
assert "!`printf 2026-04-24`" not in result["content"]
|
assert "!`printf 2026-04-24`" not in result["content"]
|
||||||
assert "!`printf 2026-04-24`" in result["raw_content"]
|
|
||||||
|
|
||||||
def test_skill_view_leaves_inline_shell_literal_when_disabled(self, tmp_path):
|
def test_skill_view_leaves_inline_shell_literal_when_disabled(self, tmp_path):
|
||||||
with (
|
with (
|
||||||
|
|
|
||||||
|
|
@ -835,7 +835,6 @@ def _serve_plugin_skill(
|
||||||
"success": True,
|
"success": True,
|
||||||
"name": f"{namespace}:{bare}",
|
"name": f"{namespace}:{bare}",
|
||||||
"content": f"{banner}{rendered_content}" if banner else rendered_content,
|
"content": f"{banner}{rendered_content}" if banner else rendered_content,
|
||||||
"raw_content": content,
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"linked_files": None,
|
"linked_files": None,
|
||||||
"readiness_status": SkillReadinessStatus.AVAILABLE.value,
|
"readiness_status": SkillReadinessStatus.AVAILABLE.value,
|
||||||
|
|
@ -1335,7 +1334,6 @@ def skill_view(
|
||||||
"tags": tags,
|
"tags": tags,
|
||||||
"related_skills": related_skills,
|
"related_skills": related_skills,
|
||||||
"content": rendered_content,
|
"content": rendered_content,
|
||||||
"raw_content": content,
|
|
||||||
"path": rel_path,
|
"path": rel_path,
|
||||||
"skill_dir": str(skill_dir) if skill_dir else None,
|
"skill_dir": str(skill_dir) if skill_dir else None,
|
||||||
"linked_files": linked_files if linked_files else None,
|
"linked_files": linked_files if linked_files else None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue