[PR #12369] core: fix unhandled errors when aborting with queued messages #14193

Closed
opened 2026-02-16 18:19:00 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12369

State: closed
Merged: Yes


Summary

  • Fixes unhandled promise rejection errors that occur when aborting a session that has a queued message waiting
  • The issue was introduced in 6c9b2c37a which changed queued callback rejections from reject() to reject(new DOMException("Aborted", "AbortError")) — callers like prompt_async don't await/catch the returned promise, so the rejection propagated as unhandled errors
  • Instead of rejecting queued callbacks on abort, we now simply drop them — the promises are GC'd and the already-persisted user messages remain in history for the next interaction
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12369 **State:** closed **Merged:** Yes --- ## Summary - Fixes unhandled promise rejection errors that occur when aborting a session that has a queued message waiting - The issue was introduced in 6c9b2c37a which changed queued callback rejections from `reject()` to `reject(new DOMException("Aborted", "AbortError"))` — callers like `prompt_async` don't await/catch the returned promise, so the rejection propagated as unhandled errors - Instead of rejecting queued callbacks on abort, we now simply drop them — the promises are GC'd and the already-persisted user messages remain in history for the next interaction
yindo added the pull-request label 2026-02-16 18:19:00 -05:00
yindo closed this issue 2026-02-16 18:19:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14193