Op agent: max-iter exhaustion should be error

t-407·WorkTask·
·
·
Created1 month ago·Updated1 month ago

Description

Edit

Represent max-iteration exhaustion as error, not normal response.

Problem

Agent loop returns "Maximum iterations reached" as a normal response and emits agent_complete, which makes traces look successful.

Requirements

  • Treat max-iteration as error/exhausted
  • Emit trace event to indicate exhaustion
  • Preserve CLI behavior (non-zero / error result)

Acceptance

  • Max-iteration runs show error/exhausted in trace and status
  • CLI returns error for max-iteration

Timeline (4)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago
💬[human]1 month ago

Agent loop now marks max-iteration as exhausted (event + state flag) and returns error in AgentResult; agent_complete is skipped when max-iter hit.