Skip to content

(bug) A delivered chat message can be marked "wasn't sent" because settlement does not wait for its own records read #6698

Description

@mmabrouk

A message that was sent and answered can be marked "Message wasn't sent — try again." The chat decides a send has settled before it knows what happened to it.

When the run stream ends, the hook that owns durable sends starts an asynchronous re-read of the session records and then reports settlement straight away, without waiting for that read. Anything still waiting at that moment is flagged as not sent. The re-read that would have cleared it lands afterwards.

The same report fires when a connection drops after the turn was accepted, even though the run may still be executing on the server.

Where it shows

  1. Open the agent chat and send a message on a queue-capable session.
  2. Delay the records read, or use a turn that finishes almost immediately, so the stream ends before the saved row is adopted.
  3. The message is answered, and the failure note appears under it anyway.

Reachable in a browser with the records read held back about 25 s. It was reached that way during the QA for #6658 before that PR gated settlement on acceptance; the gating narrowed the window rather than closing it.

What to do

  • Wait for the reconciliation that settlement starts before concluding anything from it.
  • Report admission and stream termination as separate outcomes, so a dropped connection after acceptance is not read as a finished turn.

Follow-up from #6658. Related: #6696, #6697.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions