Repository navigation
fix(runtime): report explicit step limits as incomplete - #766
Merged
Merged
Conversation
Astro-Han
force-pushed
the
fix/761-step-limit-incomplete
branch
from
July 12, 2026 09:36
d8293a1 to
c2ad12c
Compare
Astro-Han
force-pushed
the
fix/761-step-limit-incomplete
branch
from
July 12, 2026 11:41
75a0263 to
247d1b5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
step_limitinstead of a successful turn.Why
An explicit
maxStepscan 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/corenpm test -w @maka/runtimenpm test -w packages/clinpm test -w @maka/uinpm test -w @maka/headlesstool_step_cap_reachedwhile the session remains active.maka runresult.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_reachedfailure 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
Verificationexplains why it is not applicable