Skip to content

Runtime event stream drops delivery events after a full terminal page #1016

Description

@fengnanrui

Reproduction

DatabaseRuntimeEventStream checks Run delivery settlement after each limited
event page. If a full page contains a terminal event and the Run is already
settled, the generator returns even when a delivery event is on the next page.

Minimal case with batch_size=2:

  1. Persist status_changed, run_completed, delivery_succeeded in order.
  2. The stored Run delivery status is delivered.
  3. Stream the Run. Only the first two events are yielded.
  4. stream_web_chat_run raises runtime_stream_ended_without_delivery instead
    of loading the delivered message and publishing done.

The same boundary exists with the default 100-row page and with failed/cancelled
Runs or failed delivery. Full backlog pages also wait the idle poll interval.

Nine new regression cases fail against main, including the real Web Chat
adapter. Draining full pages before closure fixes them without changing the
existing short-page, cursor, tenant or delivery contracts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions