Skip to content

Reversed chat context for interrupted session.say() #7108

Description

@superMDguy

Bug Description

When a session.say() line is interrupted, the assistant turn is committed after the user's interruption, leading to a broken chat context that leads to weird LLM behavior.

Example Transcript:

Assistant: Hi this is John with
User: This is who?

Resulting Chat Context:

User: This is who?
Assistant: Hi this is John with

This causes the assistant to finish its sentence, ignoring the user line.

Expected Behavior

User turn should be committed after the interrupted assistant turn.

Reproduction Steps

https://gist.github.com/superMDguy/cfed3a2352bd3d6402bd7d0427fdc979

Operating System

macOS Tahoe

Models Used

No response

Package Versions

livekit-agents==1.7.1

Session/Room/Call IDs

No response

Proposed Solution

Additional Context

Looks like this is a regression caused by #4663, but not 100% sure

Screenshots and Recordings

No response

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions