Skip to content

feat(pipecat): record committed conversation turns on the conversation span - #797

Merged
nik13 merged 2 commits into
devfrom
feat/pipecat-conversation-transcript
Nov 25, 2026
Merged

nik13 merged 2 commits into
devfrom
feat/pipecat-conversation-transcript

Conversation

@nik13

@nik13 nik13 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

What

Pipecat calls now include the conversation in fi.conversation.transcript on the worker's parentless conversation span.

  • How: mapped exporters register a Pipecat setup file through PIPECAT_SETUP_FILES, appended once with existing entries kept. For each traced pipeline worker it attaches Pipecat's own EvalConversationObserver (Pipecat 1.13+). When the conversation ends, it writes the committed user and assistant turns in order as [{"role": "user"|"assistant", "content": "..."}]. Tool rows are dropped. The attribute is set on the conversation span itself, so any other exporter on the same provider also receives the masked transcript.
  • Privacy: nothing is attached when any of the six FI content hide settings is on (see feat(fi-instrumentation): add a shared conversation transcript policy #795, with a local fallback for older cores). Each turn is masked with the matching input/output policy, and a failed mask omits the whole attribute. There are no timestamps.
  • No-ops: Pipecat older than 1.13, tracing disabled, or a missing, ended or child conversation span. The file also provides the runner hook and the older task hook, so Pipecat does not warn about missing setup functions.

Why

Products that read a call's conversation from fi.conversation.transcript on the call root currently get nothing for Pipecat calls.

Tests

tests/test_transcript.py:

  • setup-file loading and idempotence, with existing entries preserved;
  • policy rejection, and each hide setting blocking observer attachment;
  • turn order and tool filtering;
  • role-specific masking, failed and empty masks;
  • child, ended and missing spans;
  • disabled tracing;
  • older Pipecat without the observer.

Part of TH-2379 (Linear).

🤖 Generated with Claude Code

nik13 and others added 2 commits November 25, 2026 10:27
…n span

Mapped exporters now register a Pipecat setup file (PIPECAT_SETUP_FILES,
appended once, existing entries kept). For each traced pipeline worker it
attaches Pipecat's EvalConversationObserver (Pipecat 1.13+) and, when the
conversation ends, writes fi.conversation.transcript on the worker's
parentless conversation span: committed user and assistant turns in order
as {role, content} rows. Tool rows are dropped.

- Nothing is attached when any FI input/output content hide setting is on.
- Each turn is masked with the matching input/output policy; a failed mask
  omits the whole attribute. No timestamps.
- Older Pipecat without the observer, disabled tracing, or a missing,
  ended or child conversation span: no-op.

Part of TH-2379 (Linear).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared helper is exported only from
fi_instrumentation.instrumentation.transcript; older core releases keep the
local six-setting fallback.

Part of TH-2379 (Linear).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nik13

nik13 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Review at bd51433bb3: no blocking findings. Three small follow-ups, none of which block:

  • _transcript.py:55: committed rows aren't bound to the root span. An app that rotates the conversation root itself can put one call's turns on the next. Bind rows to the root's identity at capture, or omit the transcript when ownership is uncertain.
  • exporters/base_exporter.py:263-265 exports PIPECAT_SETUP_FILES to child processes. A child that never registered a policy still runs the hook. Require process-local registration before capturing.
  • _transcript.py:76: under OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, set_attribute cuts the JSON into an invalid prefix. Omit an oversized transcript instead.

@nik13
nik13 marked this pull request as ready for review November 25, 2026 06:09
@nik13
nik13 merged commit 6dcb852 into dev Nov 25, 2026
12 checks passed
@nik13
nik13 deleted the feat/pipecat-conversation-transcript branch November 25, 2026 06:45
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.

1 participant