Skip to content

A voice message transcribed while an earlier run asked a question can be read as the answer to it #953

Open

Description

@alex-mextner

What

handleVoiceMessage saves the transcript row after download and speech-to-text, so its row id can be higher than an ask_user question that an earlier run of the same chat saved while the transcript was being made. No bot row follows the transcript, so it is not marked queued, and the day-reference guard (which uses the row id as the send order) binds it to that question. Next action: record the newest chat_history id when the voice update arrives, before download; if a bot row of that conversation was saved after it, mark the transcript as queued (turn_order) and use the arrival id as the guard's sent-at boundary. Found by the single-seat review of #942, deferred from #929.

Why (motivation)

PR 942 stops a queued text message from being read as the answer to a question it never saw; a slow transcription lets a voice message bypass that rule and consent to a duplicate, a forced create or a delete nobody offered it.

User impact

A user who speaks a reply while the bot is still working on an earlier message can have that reply taken as confirmation of a later question.

Cost of inaction

Voice replies keep a window where a confirmation is attributed to a question the speaker never heard.

Acceptance criteria

  • A synthetic voice update whose transcript row is saved after an ask_user question of an earlier run is shown to the model as queued and is not bound to that question; the test fails before the fix
  • A voice message with no run in flight is unchanged

Screenshots

(none)

Deploy

Deployed: no

Links

  • (none)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions