Skip to content

[Bug]: unpublished draft changes live calls — ambient noise, context compaction and voicemail detection are read from the workflow row instead of the run's pinned definition #716

Description

@AAlexxis222

Describe the bug

Runs are pinned to a WorkflowDefinitionModel (workflow_runs.definition_id), and WorkflowModel.workflow_configurations is a legacy column that save_workflow_draft keeps in sync with the draft (api/db/workflow_client.py, "Keep legacy columns on workflows table in sync with draft"). get_definition_configurations documents exactly this: "reading it here would let unpublished edits change live call behaviour".

The pipeline still reads three settings from the workflow row instead of the pinned definition (main):

  • api/services/pipecat/run_pipeline.py:330-334ambient_noise_configuration (telephony entry point)
  • api/services/pipecat/run_pipeline.py:463-467ambient_noise_configuration (WebRTC entry point)
  • api/services/pipecat/run_pipeline.py:844context_compaction_enabled
  • api/services/pipecat/run_pipeline.py:996voicemail_detection (including its api_key)
  • api/services/workflow/text_chat_runner.py:604context_compaction_enabled

Every other setting (max_call_duration, max_user_idle_timeout, dictionary, turn strategies, model overrides) is already read from workflow_run.definition.workflow_configurations a few lines earlier.

Impact: for inbound calls, campaigns, the public agent API, embeds and ARI — all of which pin the published definition — an unpublished draft can enable/disable voicemail detection, change context compaction, or change the ambient noise of live calls. The UI editor, test calls and text chat pin the draft, so the bug is invisible there (draft == workflow row), which is why it goes unnoticed.

Deployment mode: self-hosted (main and dograh-v1.45.0); the same code runs in the cloud-hosted app.

Steps to Reproduce

  1. Publish a workflow with voicemail detection disabled.
  2. Open the workflow settings, enable voicemail detection and save — do not publish (this creates a draft and updates the workflow row).
  3. Place an inbound call (or start a campaign) to that workflow.
  4. Observe in the logs Voicemail detection enabled for workflow run … and the voicemail sub-pipeline being created, although the published definition has it disabled.

The same steps with context_compaction_enabled or a custom ambient noise file show the draft value being used.

Expected behavior

A run pinned to the published definition uses only the published configuration; drafts have no effect until published (as is already the case for max_call_duration, turn strategies, dictionary, etc.).

Device details

Backend api on main (also dograh-v1.45.0), self-hosted; independent of browser.

Additional context

Fix is small: read the three settings from run_configs (already loaded from the pinned definition at both entry points and in _run_pipeline_impl/text_chat_runner). I have a PR ready with an integration test (api/tests/integrations/test_run_pipeline.py) that creates a draft enabling both knobs on a run pinned to V1 and asserts the engine ignores the draft.

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions