Skip to content

fix(session): retry only empty aborted turns - #28

Closed
dzianisv wants to merge 2 commits into
devfrom
issue-27-retry-empty-aborts
Closed

dzianisv wants to merge 2 commits into
devfrom
issue-27-retry-empty-aborts

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Summary

  • retry unexpected MessageAbortedError failures only when the assistant turn is still empty
  • keep interrupted turns as-is once any assistant output has already been persisted
  • add focused regression coverage for both retry and no-retry abort paths

Why

Issue #27 shows a follow-up assistant turn that was created after a successful tool-calls turn, emitted no parts, then later finalized as a generic aborted message. Retrying that specific zero-part abort is reasonable. Retrying after partial output is not, because it can duplicate assistant text or repeat tool side effects.

Changes

  • thread assistant-turn emptiness into SessionRetry.retryable() decisions
  • only retry MessageAbortedError when the session is still active and the assistant turn has no persisted parts
  • add a regression proving partial-output aborts stop instead of retrying

Testing

  • cd packages/opencode && bun test test/session/retry.test.ts test/session/processor.test.ts
  • cd packages/opencode && bun typecheck

Closes #27

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot closed this Mar 17, 2026
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.

1 participant