Skip to content

[Bug]: JSONDecodeError bypasses retry logic due to ValueError inheritance #14782

@Tranquil-Flow

Description

@Tranquil-Flow

Describe the bug

json.JSONDecodeError inherits from ValueError, but in run_agent.py the error classification treats ValueError as a local validation error (non-retryable). When a provider returns malformed JSON (transient parse failure), the agent fails immediately instead of retrying, causing unnecessary session failures on provider hiccups.

Steps to reproduce

  1. Use a provider that occasionally returns malformed JSON responses
  2. Observe that the agent fails immediately with no retry instead of retrying the request

Expected behavior

JSONDecodeError should be excluded from the local validation error classification and treated as a retryable transient error.

Environment

  • Hermes Agent version: current main
  • OS: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt buildertype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions