Skip to content

[feature] Stop repeated failed tool calls and explain how to recover #285

Closed

Description

@AetherAI3

Problem

Every refused/rejected tool result resets the host progress deadline, including the same invalid call under a fresh call ID. The local brain has a 24-turn ceiling, but the host does not recognize repeated unsuccessful actions. A model can spend turns retrying a missing argument, denied command, or unavailable operation without getting closer to the goal.

Evidence: src/commands/code.ts / src/commands/code.ts and src/core/brain_ollama.ts / src/core/brain_ollama.ts. This is a source-observed gap, not a measured production incidence.

Proposed outcome

Classify tool failures sufficiently to offer bounded recovery: invalid arguments, permission refusal, unavailable capability, stale file precondition, and execution failure. Track repeated failures for the same canonical operation and unchanged relevant state. After a documented small retry budget, stop that cycle with a useful checkpoint and next action.

Constraints and alternatives

Start in the host-executed coding/local-chat paths; hosted server-tool enforcement requires its own contract. Do not deduplicate successful calls or treat all nonzero shell exits as permanent errors. Re-running tests after an edit and a deliberate fresh retry must remain valid.

Preserve call IDs, result delivery, approval boundaries, and existing turn/time/output caps. A denied action cannot trigger a more privileged alternative. Reset the failure fingerprint when the relevant file/shell/tool state actually changes.

Acceptance

  • A fake brain repeatedly requesting the same invalid or denied action reaches a bounded stop without repeated execution/approval prompts.
  • The checkpoint states the operation, reason, attempted count, preserved work, and one useful recovery choice.
  • A corrected argument, refreshed capability, changed file revision, or edited repository allows genuine progress.
  • Transient failures receive bounded, classified retries; unknown mutation outcomes are not automatically replayed.
  • Local and coding-loop tests cover invalid args, permission denial, stale patches, failed tests after edits, and cancellation.

Priority: P1. Useful groundwork for bounded goal phase execution. Source reviewed at ca4180d (0.4.0 candidate). This ticket is an implementation spec; live service qualification remains separate.

Activity

  1. added
    enhancement
    on Oct 6, 2026
  2. AetherAI3 commented on Oct 6, 2026

    @AetherAI3
    OwnerAuthor

    Landed in #295 (squash 8751117), merged at the CI-verified head c965b43. Evidence:

    Out of scope, as the issue anticipated: hosted server-side tool enforcement and the headless aether exec loop, which need their own contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementspecux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions