You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retry unexpected MessageAbortedError instead of stopping the session #17717
OpenCode can stop a session after a provider-side abort even when the user did not cancel the run.
In the incident we investigated, an assistant message sat for ~16 minutes, produced zero tokens / zero parts, and then completed with:
MessageAbortedError
message: \"The operation was aborted.\"
The last tool call had already completed successfully. The next model call never returned any content, then the session stopped instead of retrying.
Actual behavior
When SessionProcessor catches a DOMException / AbortError, MessageV2.fromError() converts it into MessageAbortedError.
SessionRetry.retryable() does not treat that error as retryable, so the processor:
sets assistantMessage.error
publishes the error
returns \"stop\"
This makes the session appear stuck/cancelled even though the user did not explicitly cancel it.
Expected behavior
If the session's own abort signal was not triggered, an unexpected AbortError from the model/provider layer should be treated as transient and retried with the normal retry/backoff flow.
A user-initiated cancel should still stop immediately and remain non-retryable.
Root cause
Current logic treats all AbortErrors as equivalent:
user cancellation via SessionPrompt.cancel()
provider/client/network aborts while waiting for streamed output
Those cases need to be separated.
Proposed fix
detect MessageAbortedError in SessionProcessor
if input.abort.aborted === false, classify it as retryable and use the existing retry/backoff status flow
if input.abort.aborted === true, keep the current cancel behavior
add tests covering both cases
Acceptance criteria
unexpected AbortErrors retry automatically instead of stopping the session
explicit session cancellation still stops immediately
retry status is surfaced through existing SessionStatus retry flow
tests cover both retryable and non-retryable abort cases
No issue template was used. Please use one of the three required templates: Bug Report, Feature Request (title must start with [FEATURE]:), or Question. The content here fits the Bug Report or Feature Request template — please resubmit using the appropriate one.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Activity
github-actions commentedon Mar 16, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:), or Question. The content here fits the Bug Report or Feature Request template — please resubmit using the appropriate one.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
MessageAbortedErrorfrom provider-side failuresIf you believe this was flagged incorrectly, please let a maintainer know.
fix(session): retry unexpected abort errors (anomalyco#17717)
dzianisv commentedon Mar 16, 2026
I opened a fix PR for this: #17719
What it changes:
MessageAbortedErrorfailures when the session itself was not cancelledpackages/opencode/test/session/llm.test.tsso the repo hook/typecheck passesValidation:
bun test test/session/retry.test.ts test/session/processor.test.tsbun test --timeout 30000bun typecheckgithub-actions commentedon Mar 16, 2026
This issue 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 issue that follows our issue templates.
fix(session): retry only empty aborts (anomalyco#17717)
fix(session): retry unexpected abort errors (anomalyco#17717)
fix(session): retry only empty aborts (anomalyco#17717)
fix(session): retry unexpected abort errors (anomalyco#17717)
fix(session): retry only empty aborts (anomalyco#17717)