Skip to content

[Feature] Configurable Retry Limits to Prevent Token Drain #897

Description

@akramcodez

Description

Introduce a hard limit on how many times the agent can automatically retry a failed tool call (like a failing search_replace or a syntax error fix) without user intervention.

Use Case

If an agent gets stuck in a loop trying to fix a bug, it can quickly consume a massive amount of API tokens. Users want a safeguard to prevent runaway costs.

Proposed Solution

Add a maxRetries setting (defaulting to 3) in agents.config.json that pauses execution and asks the user how to proceed once hit.

Alternatives Considered

Relying on the user to manually hit Ctrl+C in time, which is error-prone.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • This feature aligns with the project's goals (local-first AI assistance)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions