Problem
In Goal mode, if the current Task reaches max_turns, the Goal immediately ends as aborted and no new Task is started, even when the Goal has no token budget limit.
Current behavior:
Task 1 reaches max_turns
→ final message has stop_reason: failed
→ goal_finished(outcome: aborted)
This prevents Goal mode from helping the long-running tasks that most need continuation.
Expected behavior
Keep max_turns as the limit for one Task, but treat reaching it as a round boundary:
Task 1 reaches max_turns
→ preserve workspace and progress
→ start Task 2 for the same Goal
The Goal can still be bounded by its token budget, maxRounds, user aborts, and no-progress protection.
Relevant code
packages/core/src/goal/goal-loop.ts currently treats a max-turn cutoff as terminal via roundFailed and returns goal_finished("aborted").
Problem
In Goal mode, if the current Task reaches
max_turns, the Goal immediately ends asabortedand no new Task is started, even when the Goal has no token budget limit.Current behavior:
This prevents Goal mode from helping the long-running tasks that most need continuation.
Expected behavior
Keep
max_turnsas the limit for one Task, but treat reaching it as a round boundary:The Goal can still be bounded by its token budget,
maxRounds, user aborts, and no-progress protection.Relevant code
packages/core/src/goal/goal-loop.tscurrently treats a max-turn cutoff as terminal viaroundFailedand returnsgoal_finished("aborted").