Patch Changes
-
#890
22dbd2cThanks @ask-bonk! - Fix_flushQueue()permanently blocking when a queued callback throwsA throwing callback in
_flushQueue()previously caused the failing row to never be dequeued, creating an infinite retry loop that blocked all subsequent queued tasks. Additionally,_flushingQueuewas never reset tofalseon error, permanently locking the queue for the lifetime of the Durable Object instance.The fix wraps each callback invocation in try-catch-finally so that failing items are always dequeued and subsequent items continue processing. The
_flushingQueueflag is now reset in a top-level finally block. Missing callbacks are also dequeued instead of being skipped indefinitely.Note for existing stuck Durable Objects: This fix is self-healing for poison rows — they will be properly dequeued on the next
_flushQueue()call. However,_flushQueue()is only triggered by a newqueue()call, not on DO initialization. If you have DOs stuck in production, you can either trigger a newqueue()call on affected DOs, or calldequeueAll()/dequeueAllByCallback()to clear the poison rows manually. A future improvement may add a_flushQueue()call toonStart()so stuck DOs self-heal on wake. -
#891
0723b99Thanks @ask-bonk! - FixgetCurrentAgent()returningundefinedconnection when used with@cloudflare/ai-chatand Vite SSRRe-export
agentContextas__DO_NOT_USE_WILL_BREAK__agentContextfrom the mainagentsentry point and update@cloudflare/ai-chatto import it fromagentsinstead of theagents/internal_contextsubpath export. This prevents Vite SSR pre-bundling from creating two separateAsyncLocalStorageinstances, which causedgetCurrentAgent().connectionto beundefinedinsideonChatMessageand toolexecutefunctions.The
agents/internal_contextsubpath export has been removed frompackage.jsonand the deprecatedagentContextalias has been removed frominternal_context.ts. This was never a public API. -
Updated dependencies [
584cebe,0723b99,4292f6b]:- @cloudflare/ai-chat@0.0.8