hermes - 💡(How to fix) Fix [Bug]: skill_manage tool fails with "file_content is required" when agent mistakenly passes content instead of file_content

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Log WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false} In tools/skill_manager_tool.py, the skill_manage function strictly checks for file_content during a write_file action and throws an error if it's missing, without checking if the LLM provided the text in the content field instead. Observe the tool execution failure in the terminal or logs: WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false} Observe the tool execution failure in the terminal or logs: WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false}

Additional Logs / Traceback (optional)

Root Cause

Because the Python backend strictly checks for file_content, it fails and blocks the agent from saving the file, resulting in lost auxiliary skill files.

Fix Action

Fix / Workaround

if action == "create": # Fallback to file_content if LLM gets confused content = content if content is not None else file_content if not content: return tool_error("content is required for 'create'. Provide the full SKILL.md text (frontmatter + body).", success=False) result = _create_skill(name, content, category) elif action == "edit": # Fallback to file_content if LLM gets confused content = content if content is not None else file_content if not content: return tool_error("content is required for 'edit'. Provide the full updated SKILL.md text.", success=False) result = _edit_skill(name, content) # ... [patch and delete logic remains unchanged] ... elif action == "write_file": if not file_path: return tool_error("file_path is required for 'write_file'. Example: 'references/api-guide.md'", success=False)

Code Example

⚠️  This will upload the following to a public paste service:
System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report       https://paste.rs/WCmPP
  agent.log    https://paste.rs/2xqpD
  gateway.log  https://paste.rs/lT93d

Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

---
RAW_BUFFERClick to expand / collapse

Bug Description

When the agent uses the skill_manage tool to perform a write_file action (to create or update supporting files in a skill directory), it sometimes gets confused by the schema and passes the file's text using the content argument instead of the file_content argument.

Because the Python backend strictly checks for file_content, it fails and blocks the agent from saving the file, resulting in lost auxiliary skill files.

Error Log json

WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false} Root Cause The OpenAI JSON schema for skill_manage is highly multiplexed. It has a content field (used for create/edit actions) and a file_content field (used for write_file). Because neither field is strictly enforced in the JSON schema's required array, the LLM will occasionally swap them.

In tools/skill_manager_tool.py, the skill_manage function strictly checks for file_content during a write_file action and throws an error if it's missing, without checking if the LLM provided the text in the content field instead.

Proposed Fix Make skill_manager_tool.py gracefully fall back to the other parameter if the required one is missing.

In tools/skill_manager_tool.py within the skill_manage function:

python

if action == "create":
    # Fallback to file_content if LLM gets confused
    content = content if content is not None else file_content
    if not content:
        return tool_error("content is required for 'create'. Provide the full SKILL.md text (frontmatter + body).", success=False)
    result = _create_skill(name, content, category)
elif action == "edit":
    # Fallback to file_content if LLM gets confused
    content = content if content is not None else file_content
    if not content:
        return tool_error("content is required for 'edit'. Provide the full updated SKILL.md text.", success=False)
    result = _edit_skill(name, content)
# ... [patch and delete logic remains unchanged] ...
elif action == "write_file":
    if not file_path:
        return tool_error("file_path is required for 'write_file'. Example: 'references/api-guide.md'", success=False)
    
    # Fallback to content if LLM gets confused
    file_content = file_content if file_content is not None else content
    if file_content is None:
        return tool_error("file_content is required for 'write_file'.", success=False)
    result = _write_file(name, file_path, file_content)

Feel free to copy this exactly as it is; it gives the Hermes developers everything they need to implement the fix!

Steps to Reproduce

teps to Reproduce Start a conversation with the Hermes agent. Ask the agent to create a new skill that requires a supporting file, or directly prompt the agent to execute a write_file action but specifically instruct it to use the content parameter instead of file_content to simulate the LLM's mistake. For example, you can tell the agent: "Please call the skill_manage tool with action="write_file", name="test-skill", file_path="scripts/test.py", and put the file's text in the content argument instead of file_content." Observe the tool execution failure in the terminal or logs: WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false}

Expected Behavior

Because content and file_content serve the exact same conceptual purpose (providing the text payload for the file being written/edited), the tool should be robust against the LLM mixing them up.

If the LLM provides content during a write_file action, the tool should gracefully use that text as the file content instead of failing. Similarly, if the LLM provides file_content during a create or edit action, it should gracefully use that text as the SKILL.md content. The action should succeed and the file should be saved correctly.

Actual Behavior

Observe the tool execution failure in the terminal or logs: WARNING agent.tool_executor: Tool skill_manage returned error (0.00s): {"error": "file_content is required for 'write_file'.", "success": false}

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

⚠️  This will upload the following to a public paste service:
  • System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
  • Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
  • Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report       https://paste.rs/WCmPP
  agent.log    https://paste.rs/2xqpD
  gateway.log  https://paste.rs/lT93d

⏱  Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Operating System

windows

Python Version

3.11

Hermes Version

0.15

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: skill_manage tool fails with "file_content is required" when agent mistakenly passes content instead of file_content