fix: forward billing-v2 protocol on textchat KB retrieval and node summaries (#503)

Two call sites dropped the MPS billing-v2 protocol, so orgs on model
config v2 got 400 "Service Key uses billing v2" from MPS:

- text_chat_runner built PipecatEngine without embeddings_provider
  (extracted but never passed), so knowledge-base retrieval fell through
  to the plain OpenAI-compatible client instead of DograhEmbeddingService
  and sent no correlation_id/mps_billing_version metadata. Also pass
  endpoint/api_version for Azure BYOK parity with run_pipeline.
- node_summary built its QA LLM without the run's correlation id, unlike
  its sibling call in qa/analysis.py.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Abhishek 2026-07-06 22:58:53 +05:30 committed by GitHub
parent 4fb3193eb5
commit 7e2750f83f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View file

@ -532,6 +532,9 @@ async def execute_text_chat_pending_turn(
embeddings_api_key = None
embeddings_model = None
embeddings_base_url = None
embeddings_provider = None
embeddings_endpoint = None
embeddings_api_version = None
if user_config.embeddings:
from api.services.configuration.ai_model_configuration import (
apply_managed_embeddings_base_url,
@ -544,6 +547,8 @@ async def execute_text_chat_pending_turn(
provider=embeddings_provider,
base_url=getattr(user_config.embeddings, "base_url", None),
)
embeddings_endpoint = getattr(user_config.embeddings, "endpoint", None)
embeddings_api_version = getattr(user_config.embeddings, "api_version", None)
has_recordings = await db_client.has_active_recordings(workflow.organization_id)
context_compaction_enabled = (workflow.workflow_configurations or {}).get(
@ -560,6 +565,9 @@ async def execute_text_chat_pending_turn(
embeddings_api_key=embeddings_api_key,
embeddings_model=embeddings_model,
embeddings_base_url=embeddings_base_url,
embeddings_provider=embeddings_provider,
embeddings_endpoint=embeddings_endpoint,
embeddings_api_version=embeddings_api_version,
has_recordings=has_recordings,
context_compaction_enabled=context_compaction_enabled,
)