fix(agent-core): suppress the spurious error event for step-capped goal turns#2217
Open
chengluyu wants to merge 1 commit into
Open
fix(agent-core): suppress the spurious error event for step-capped goal turns#2217chengluyu wants to merge 1 commit into
chengluyu wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: aefbc7f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
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.
Related Issue
Follow-up to #2210 (which made goal pursuit continue across the per-turn step limit). The problem is explained below.
Problem
After #2210, a goal turn that hits
loop_control.max_steps_per_turnno longer pauses the goal — but the TUI still renders a red, actionable error banner for every capped turn:Root cause:
runOneTurn's catch path emits a standaloneerrorevent for any failed turn (in addition toturn.ended{reason:'failed'}and theturn.interrupted{reason:'max_steps'}loop event). The TUI's session-error handler renders that event as an actionable failure. For goal-driven turns the cap is expected control flow — the driver immediately starts the next continuation turn — so the banner is pure noise that makes an intentional limit look like a malfunction.What changed
TurnFlow.runOneTurn, the standaloneerrorevent is no longer emitted when the failure isloop.max_steps_exceededand a goal is active (i.e. exactly the turns the goal driver will continue). Everything else is preserved:turn.ended{reason:'failed', error:…}, theturn.interrupted{reason:'max_steps'}loop event, theStopFailurehook, and API-error telemetry.errorevents; the existing non-goal max-steps test now asserts the event is still emitted (right afterturn.ended).@moonshot-ai/kimi-code, patch).Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.