Skip to content

post_actions: FunctionActionFrame executes before TTS finishes due to concurrent audio context #4038

@batuhanbadak

Description

@batuhanbadak

pipecat version

v0.0.105

Python version

3.13

Operating System

Ubuntu

Issue description

After upgrading to pipecat v0.0.105, post_actions with {"type": "function"} execute while TTS is still speaking the LLM-generated response. The FE receives the event (e.g. "conversation ended") and closes the screen before the user hears the bot's closing message.

Reproduction steps

  1. Create a pipecat-flows node where the LLM generates speech based on role_messages/task_messages
  2. Add post_actions with {"type": "function", "handler": my_handler} — this handler sends a frontend event signaling the conversation is over
  3. Use CartesiaTTSService on pipecat v0.0.105
  4. Observe that my_handler executes while TTS is still speaking the LLM-generated response — the FunctionActionFrame passes through TTS without waiting for audio to finish

Expected behavior

Post-action FunctionActionFrame should be processed after TTS finishes speaking the LLM response, not concurrently. I fixed the issue by setting the private _pause_frame_processing, which resolved the issue on our end. However, this relies on a private API that could change without notice.

Actual behavior

After upgrading to pipecat v0.0.105, post_actions with {"type": "function"} execute while TTS is still speaking the LLM-generated response. The FE receives the event (e.g. "conversation ended") and closes the screen before the user hears the bot's closing message.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions