It's very appealing to limit the number of turns for attempting a task by setting Task(max_turns=...) but unfortunately in practice this isn't straightforward. If a single agent is applied to the task, then it can iterate forever because there is no concept of formally "ending" a turn. On the other hand, we can't use LLM invocations because a turn usually requires two invocations - one to use a tool and another to process it. For the moment, enforcing operational limits at the Task level is too complex. We will leave run() limits in place.
It's very appealing to limit the number of turns for attempting a task by setting
Task(max_turns=...)
but unfortunately in practice this isn't straightforward. If a single agent is applied to the task, then it can iterate forever because there is no concept of formally "ending" a turn. On the other hand, we can't use LLM invocations because a turn usually requires two invocations - one to use a tool and another to process it. For the moment, enforcing operational limits at the Task level is too complex. We will leaverun()
limits in place.