Op agent: max-iter exhaustion should be error

t-407·WorkTask·
·
·
Created3 months ago·Updated3 months ago·pipeline runs →

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 → InProgress3 months ago
🔄[human]InProgress → Done3 months ago
💬[human]3 months 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.