fix(agent): clear stale failure state when resuming runner iterations - #5995
Merged
Merged
Conversation
Re-bin
force-pushed
the
fix/clear-recovered-runner-errors
branch
from
October 2, 2026 15:07
7293b7c to
aea1740
Compare
Re-bin
force-pushed
the
fix/clear-recovered-runner-errors
branch
from
October 2, 2026 16:54
aea1740 to
30960fa
Compare
Re-bin
approved these changes
Oct 2, 2026
Re-bin
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Resets iteration-local failure state so a recovered run is not reported as failed, while preserving real terminal errors. Current-head CI and focused runner tests pass; request assembly and runtime ownership are unchanged.
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
Fix successful recovery being reported as a failed run after a late follow-up message, which can suppress the final WebSocket reply.
Root Cause
The model-error and empty-response paths assign
stop_reasonanderrorbefore checking for late follow-up messages.When a follow-up resumes execution, these values survive into subsequent iterations. A successful response replaces the content but retains the previous failure state.
For model errors, this causes TurnDelivery to skip the final WebSocket reply and publish a failed completion. The runner also invokes
on_errordespite having recovered successfully.Changes
stop_reasonanderrorat the start of each runner iteration.Result
Recovered runs return
stop_reason="completed"anderror=None. The final WebSocket reply is queued, and turn completion reports success.Failures that terminate execution continue to retain their failure state.
Test
empty_final_response.nanobot/agent/runner.py.git diff --checkpassed.