#679·flue

Queued note acknowledgments can be lost when start hooks buffer signals before stream commit

Author: astrobot-houstonCreated Sep 12, 2026Updated Sep 12, 2026

Originally reported by @zvsdev in #676.

All community-submitted pull requests are automatically converted to issues (bugs) & discussions (feature requests, enhancements) where they can be triaged and prioritized. Once prioritized, a PR implementation is created automatically.

Describe the Bug

Start hooks buffer signals before the stream commits. When a consumer deletes a queued note after append() returns, that note can be silently lost if another hook in the batch or the batch itself fails. The deletion happens outside the transaction boundary, so there is no rollback — the note is removed from the local queue but never committed to the stream.

This affects the local SQLite store in packages/runtime. The memory and async SQL stores are not impacted because they do not support acknowledgments.

Expected Behavior

Queued note deletions should be atomic with the rest of the start-hook batch. If any hook or the batch commit fails, the deletion should roll back so the note remains in the queue and is not lost. Acknowledgments (row deletions) should occur inside the same transaction that stores signals, state writes, and the start marker.

Steps to Reproduce

  1. Set up an agent with a start hook that calls append(message) to consume a note from a local SQLite queue, then deletes the corresponding queue row after append() returns.
  2. Arrange for a subsequent hook in the same batch to fail (or for the batch commit itself to fail).
  3. Observe that the queue row has been deleted but the appended message was never committed to the stream — the note is lost.

Original implementation from #676 by @zvsdev