Skip to content

fix: always include parameters in Genesys AudioHook messages#4093

Merged
markbackman merged 2 commits intopipecat-ai:mainfrom
poislagarde:fix/genesys-pong-parameters
Mar 20, 2026
Merged

fix: always include parameters in Genesys AudioHook messages#4093
markbackman merged 2 commits intopipecat-ai:mainfrom
poislagarde:fix/genesys-pong-parameters

Conversation

@poislagarde
Copy link
Copy Markdown
Contributor

Summary

The AudioHook protocol requires every message to include a parameters object (even if empty {}). The _create_message method conditionally included it only when parameters were truthy:

if parameters:
    msg["parameters"] = parameters

This meant pong responses and closed responses without outputVariables were sent without a parameters field at all.

The Genesys reference client validates every incoming message with isMessageBase, which requires isJsonObject(msg['parameters']). Without the field, the message fails validation and triggers a fatal protocol error. This causes a cascade:

  1. Client rejects the pong → doesn't update its serverseq tracker
  2. Next message (closed) arrives with a higher-than-expected seq → protocol error
  3. Client rejects closedoutputVariables never reach the Architect flow

Fix

msg["parameters"] = parameters if parameters is not None else {}

Testing

  • All 28 existing Genesys serializer unit tests pass (updated 2 to match new behavior)
  • Tested against the Genesys AudioHook reference implementation test client (client/). Before the fix, the client logged Protocol error: Current serverseq=1 and incoming message has seq=3 and the session ended in CLOSING-ERROR. After the fix, the session completes cleanly:
INFO: onOpenedMessage - Session open! Parameters: {"startPaused":false,"media":[...],"selectedLanguage":"en-US"}
INFO: onPongMessage - rtt: 3.8ms
INFO: Source stream ended (duration: PT3S), closing session.
INFO: onClosedMessage - Session closed (state: CLOSING)
INFO: All sessions disconnected, exiting

Changelog

Included as changelog/0000.fixed.md — happy to rename to the PR number once assigned.

🤖 Generated with Claude Code

poislagarde and others added 2 commits March 20, 2026 16:37
The AudioHook protocol requires every message to carry a `parameters`
object. `_create_message` conditionally included it only when parameters
were truthy, so pong responses and closed responses without
outputVariables were sent without the field.

Clients that validate message structure (including the Genesys reference
implementation) rejected these messages, which broke server sequence
tracking and prevented outputVariables from reaching the Architect flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution 🙇

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/pipecat/serializers/genesys.py 77.67% <100.00%> (-0.07%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@markbackman markbackman merged commit a9a1941 into pipecat-ai:main Mar 20, 2026
6 checks passed
markbackman pushed a commit that referenced this pull request Mar 21, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants