Skip to content

fix(runtime): report explicit step limits as incomplete #761

Closed

Description

@Astro-Han

Part of #759.

Scope

  • Add the step_limit terminal reason across runtime events, persistence, replay, and InvocationResult.
  • Reuse the established tool_step_cap_reached failure class across runtime, Turn, AgentRun, CLI, and Headless consumers.
  • Show a fixed, non-assistant system notice when an explicit limit is reached.
  • Keep the session active so the existing TUI and Desktop composer can continue the task.
  • Return non-zero from maka run without successful output.

Acceptance criteria

  • An explicit step limit produces step_limit, not end_turn.
  • The terminal reason and failure class survive persistence and replay.
  • Reaching the limit does not make another model request or synthesize assistant text.
  • TUI and Desktop show the same fixed system notice during live use and history replay.
  • Interactive entry points stop and wait for user input; existing Headless harnesses may apply their own continuation policy.
  • maka run returns non-zero.
  • Tests cover runtime, persistence, CLI, UI materialization, and Headless compatibility.

Out of scope

  • Model-generated finalization.
  • Default step budgets.
  • Automatic continuation in interactive clients.
  • New TUI or Desktop controls.
  • General doom-loop detection.

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