Skip to content

Goal mode aborts instead of continuing after a Task reaches max_turns #171

Description

@zzzbitz

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").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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