hermes - 💡(How to fix) Fix [Bug]: Agent autonomously tries unverified alternatives after tool failures, causing massive token waste

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

When a tool call fails (SSH timeout, file not found, command error), the Agent autonomously fires off a series of alternative attempts without first consulting historical records or known solutions. These attempts are based on the Agent's guesswork rather than verified workflows.

  • All error output floods context → burns token budget

Additional Logs / Traceback (optional)

Root Cause

Agent's default behavioral pattern is: "tool fails → try alternatives" instead of "tool fails → stop → search known solutions → pick a documented approach". This is a reasoning priority issue: exploration/retry has higher priority than consulting knowledge records.

Code Example

Debug report links:

Report:       https://dpaste.com/7SD7JZPS2
agent.log:    https://dpaste.com/68M85A26Z
gateway.log:  https://dpaste.com/4R3U4T7RG

6小时后自动删除。

---
RAW_BUFFERClick to expand / collapse

Bug Description

When a tool call fails (SSH timeout, file not found, command error), the Agent autonomously fires off a series of alternative attempts without first consulting historical records or known solutions. These attempts are based on the Agent's guesswork rather than verified workflows.

Consequences:

  1. Massive wasted token consumption (~$50+ paid by a single user)
  2. User repeatedly corrects the same behavior (dozens of occurrences)
  3. Wasted user time and patience

Steps to Reproduce

  1. Agent calls terminal() to execute ssh HOST 'wsl.exe SOMETHING'
  2. SSH connection times out or errors out
  3. Agent does NOT query historical records/skills/state.db — immediately tries alternatives:
    • Different parameters → fails
    • Add sleep() → fails
    • Different connection method (tar pipe) → fails
    • All error output floods context → burns token budget
  4. User intervenes: "check the skill/records" → Agent repeats the same mistake next time

Expected Behavior

First try of an action fails. it should go back to skills, not go to explore new routes. Many repeated wrong actions repeatedly occur while the amending skills already exists.

Root Cause

Agent's default behavioral pattern is: "tool fails → try alternatives" instead of "tool fails → stop → search known solutions → pick a documented approach". This is a reasoning priority issue: exploration/retry has higher priority than consulting knowledge records.

Actual Behavior

If one action fails, it will keep try different routes to work around it.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Debug Report

Debug report links:

Report:       https://dpaste.com/7SD7JZPS2
agent.log:    https://dpaste.com/68M85A26Z
gateway.log:  https://dpaste.com/4R3U4T7RG

6小时后自动删除。

Operating System

Ubuntu 24.04.4 LTS

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

Agent's default behavioral pattern is: "tool fails → try alternatives" instead of "tool fails → stop → search known solutions → pick a documented approach". This is a reasoning priority issue: exploration/retry has higher priority than consulting knowledge records.

Proposed Fix (optional)

  1. On tool failure: inject a system-level message — "Tool failed. STOP. Search records/skills first before trying anything."
  2. Auto-trigger session_search: when a tool fails, automatically kick off a knowledge lookup
  3. Retry budget: limit automatic retries to 1 attempt, then force knowledge lookup before proceeding

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]: Agent autonomously tries unverified alternatives after tool failures, causing massive token waste