Skip to content

Infinite tool loops leading to too_many_requests due to AOAI tool/function behavior #155

@marklicata

Description

@marklicata

Type: Bug (runtime control / orchestration)
Priority: Critical (causes hard failure + cost explosion)

Problem Statement
Amplifier frequently enters infinite or near‑infinite execution loops when using AOAI, especially in scenarios involving tool or function calls.
These loops:

  • Burn massive token volumes
  • Trigger 429 (too_many_requests) errors
  • Leave users unsure whether Amplifier is making progress or stalled

Observations

  • Multiple users independently observed the same looping → 429 pattern [Amplifier...Recording | Video]
  • Loops often occur after seemingly valid planning phases
  • This is a known OpenAI/AOAI issue tied to tool/function call semantics
  • Users were forced to manually interrupt and abandon runs

Impact

  • Hard task failure after long waits
  • Massive, unbounded token consumption
  • Loss of trust in autonomous mode
  • Makes Amplifier unsafe to run unattended

Requested Changes
Loop detection

  • Detect repeated tool/function call patterns
  • Identify non‑advancing execution states

Hard execution guards

  • Max tool call count per task
  • Max wall‑clock duration per run

Graceful failure

  • Stop execution early
  • Report why execution halted
  • Preserve partial artifacts (plans, drafts)

Acceptance Criteria

  • Amplifier cannot run indefinitely without progress
  • 429 errors are handled with retry/backoff or early termination
  • Users always understand why a run stopped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions