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
Commit 20cc4b6
Browse filesBrowse the repository at this point in the historyBrowse files
Fix awaiting an event handler from a background task
An exception raised by a handler awaited from a background task (no state
lock held, so the event is enqueued) was delivered to the awaiting task and
also reported to the backend exception handler, showing the error toast even
when the task caught it. The enqueued event's future is now marked as awaited,
and its exception is left to the caller: if the task does not catch it, the
task's own failure reports it once.
A supersedes=True handler run that had returned, but whose task done callback
had not yet resolved its future, was cancelled by a newer invocation enqueued
in that window, so the awaiting task got CancelledError for a run that
completed. The in-memory state manager hits the window because a task waiting
for the state lock resumes without suspending before it enqueues. Superseding
such a run now only cancels the events it chained.
Closes#7839
Claude-Session: https://claude.ai/code/session_01LwJUCU8RtEco15mQvkxdQb
Awaiting an event handler from a background task now behaves like the inline call: an exception the task catches is no longer also reported to the backend exception handler (no error toast), and a `supersedes=True` handler run that finished before a newer one superseded it returns its result instead of raising `CancelledError`.
0 commit comments