Skip to content

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

Merged
Astro-Han merged 12 commits into
mainfrom
fix/761-step-limit-incomplete
Jul 12, 2026
Merged

Astro-Han merged 12 commits into
mainfrom
fix/761-step-limit-incomplete

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Report an explicit tool-step limit as step_limit instead of a successful turn.
  • Show a deterministic, non-assistant system notice without making another model request.
  • Keep the session active so the existing composer can continue the task.

Why

An explicit maxSteps can stop a turn before the requested work is complete. Treating that outcome as success hides unfinished work from users, persistence, CLI callers, and benchmark consumers.

The runtime should report this fact directly. Asking the model to summarize after the budget is exhausted adds cost, latency, lifecycle edge cases, and the risk of misleading completion claims without improving the underlying result.

Fixes #761.

Scope

Automatic continuation in interactive clients, new UI controls, default step budgets, and general loop detection remain out of scope. Existing Headless harnesses retain their own continuation policies.

Verification

  • npm test -w @maka/core
  • npm test -w @maka/runtime
  • npm test -w packages/cli
  • npm test -w @maka/ui
  • npm test -w @maka/headless
  • All passed.
  • Runtime tests verify that no auxiliary model request or synthetic assistant text is produced.
  • Persistence tests verify that the turn and run use tool_step_cap_reached while the session remains active.
  • CLI tests verify the live notice, history replay, continuation guard, and non-zero maka run result.
  • UI tests verify that the existing system-note component renders the fixed notice.
  • Visual evidence is not included because this reuses the existing system-note presentation without changing layout or interaction; text and materialization contracts cover the visible change.

Impact

Explicitly configured step limits now produce a non-success result and a fixed system notice. Consumers continue to use the established tool_step_cap_reached failure class. No migration or configuration changes are required.

The change makes no additional model request, so reaching the limit adds no model latency or token cost.

Reviewer notes

The terminal RuntimeEvent is the single persisted source of truth. Live clients and history projection derive the same notice from it rather than storing a second business fact.

The implementation deliberately avoids a new lifecycle status: the turn and run fail, while the session remains active for manual continuation.

Ready for review

  • Verification is complete and the results above are current
  • Impact, compatibility, migration, documentation, and release-note needs are addressed
  • User-visible UI/UX changes include visual evidence, or Verification explains why it is not applicable

@Astro-Han
Astro-Han force-pushed the fix/761-step-limit-incomplete branch from d8293a1 to c2ad12c Compare July 12, 2026 09:36
@Astro-Han
Astro-Han force-pushed the fix/761-step-limit-incomplete branch from 75a0263 to 247d1b5 Compare July 12, 2026 11:41
@Astro-Han
Astro-Han merged commit dcd867b into main Jul 12, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the fix/761-step-limit-incomplete branch July 12, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(runtime): report explicit step limits as incomplete

1 participant