fix(v1): clear handled model call errors - #2457
Merged
Merged
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized one-line fix that clears only transient handled model-call errors after clean segment completion while preserving recorded call history and failure attribution for exceptional paths. It introduces no new capability, schema, security, billing, or infrastructure surface. You can add or adjust custom eligibility rules. Learn more. |
mikasenghaas
approved these changes
Aug 28, 2026
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
Why
PR #2456 lets a harness complete cleanly after handling a relayed model-call failure, but the resolved error remained in
RolloutSession.error. An interactive segment can then fail before its next model request resets that slot, causingRollout.step()to record the stale provider error instead of the new request-interceptor or harness failure.The reset happens only after
HarnessSession.turn()succeeds, so a harness crash in the current segment still records the intercepted provider error.Verification
uv run pytest tests/ -quv run ruff check --fix .uv run ty check verifiersuv run pre-commit run --files verifiers/v1/rollout.pyThe all-files pre-commit run retains the existing MD033 failures in the unchanged legacy SWE README; the changed-file hooks pass.
Note
Low Risk
Single-line lifecycle fix in rollout stepping with targeted regression tests; no auth or data-path changes.
Overview
After a harness segment finishes without raising,
Rollout.step()now setsself._session.error = None, so a provider failure that was handled in-segment (e.g. context overflow) does not linger on the session.That stale slot previously could win in the
step()exception path (real = self._session.error) when a later segment failed before the next model call cleared it—masking the new interceptor or harness error. Failures in the current segment are unchanged: the clear runs only afterturn()succeeds, so a harness crash still surfaces the stashed provider error.Reviewed by Cursor Bugbot for commit b61b045. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Clear
self._session.errorafter segment completion inRolloutResets the session error state to
Noneafter a segment finishes and after agent time remaining and deadline are updated. No other logic or return conditions were changed.Macroscope summarized b61b045.