Skip to content

fix: serialize standard context tools#4123

Open
sysradium wants to merge 1 commit intopipecat-ai:mainfrom
sysradium:sysradium/otel-fix
Open

fix: serialize standard context tools#4123
sysradium wants to merge 1 commit intopipecat-ai:mainfrom
sysradium:sysradium/otel-fix

Conversation

@sysradium
Copy link
Contributor

@sysradium sysradium commented Mar 24, 2026

Guard tool extraction so that when context tools expose a standard_tools list we include both their raw form and a sanitized serialized version with name/description tuples; fall back to the previous behavior otherwise.

The same pattern is already being used in llm_setup branch.

Currently it leads to this issue:

app-1  | 2026-03-24 16:08:46.470 | DEBUG    | pipecat.pipeline.task:_wait_for_pipeline_start:748 - PipelineTask#0: StartFrame#0 reached the end of the pipeline, pipeline is now
ready.
app-1  | WARNING:root:Error extracting context tools: Object of type ToolsSchema is not JSON serializable
app-1  | ERROR:root:Error in OpenAI Realtime tracing (continuing without tracing): object of type 'ToolsSchema' has no len()
app-1  | 2026-03-24 16:08:46.478 | DEBUG    | pipecat.adapters.base_llm_adapter:from_standard_tools:127 - Retrieving the tools using the adapter: <class
'pipecat.adapters.services.open_ai_realtime_adapter.OpenAIRealtimeLLMAdapter'>
app-1  | 2026-03-24 16:08:46.599 | DEBUG    | pipecat.services.openai.realtime.llm:_create_response:1034 - Setting up conversation on OpenAI Realtime LLM service with initial
messages

Guard tool extraction so that when context tools expose a `standard_tools` list we include both their raw form and a sanitized serialized version with name/description tuples; fall back to the previous behavior otherwise.
@sysradium sysradium force-pushed the sysradium/otel-fix branch from 71f7959 to 4bf1f5f Compare March 24, 2026 16:18
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/utils/tracing/service_decorators.py 0.00% 11 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/utils/tracing/service_decorators.py 12.50% <0.00%> (-0.22%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sysradium sysradium marked this pull request as ready for review March 24, 2026 16:21
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