Skip to content

fix(v1): clear handled model call errors - #2457

Merged
mikasenghaas merged 1 commit into
mainfrom
codex/clear-handled-rollout-error
Aug 28, 2026
Merged

fix(v1): clear handled model call errors#2457
mikasenghaas merged 1 commit into
mainfrom
codex/clear-handled-rollout-error

Conversation

@xeophon

@xeophon xeophon commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • clear a handled model-call error when a harness segment exits cleanly
  • prevent that stale provider error from replacing a later segment's real failure

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, causing Rollout.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

  • exact two-segment regression probe: handled overflow followed by request-interceptor failure
  • current-segment probe: harness failure still records the provider error
  • uv run pytest tests/ -q
  • uv run ruff check --fix .
  • uv run ty check verifiers
  • uv run pre-commit run --files verifiers/v1/rollout.py

The 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 sets self._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 after turn() 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.error after segment completion in Rollout

Resets the session error state to None after a segment finishes and after agent time remaining and deadline are updated. No other logic or return conditions were changed.

Macroscope summarized b61b045.

@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b61b045

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
mikasenghaas merged commit 5f24fb8 into main Aug 28, 2026
13 checks passed
@mikasenghaas
mikasenghaas deleted the codex/clear-handled-rollout-error branch August 28, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants