fix(crew): emit tool_call events so crew tool calls show on the platform - #102
Merged
Merged
Conversation
…how on the platform Crew tools run inside the deployed pod, so the platform never saw them: the ToolRegistry executed tools silently and emitted nothing. Single-prompt agents show tool calls because the platform LLM emits the events; crew agents showed none, so a crew transfer_call (and every other @function_tool) was invisible on the call's Events tab even though it fired. ToolRegistry.discover() now captures the owning crew node, and _execute_single emits SDKAgentLogEvent(name=tool_call_start|tool_call_end|tool_call_error) over the node's websocket around each call. pipecat's agent_log_router already maps those to the platform TOOL_CALL_* events (allowlisted on /events + persisted to ClickHouse), so no pipecat/atoms change is needed. Zero change to user crew code — the events flow as soon as a crew redeploys on this SDK. Emission never breaks tool execution (all failures swallowed); standalone registries stay silent. Covers transfer_call, giving crew agents the same Events-tab visibility as single-prompt agents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Crew agents show no tool-call events on the platform's Events tab, while single-prompt agents do. A customer reported their crew
transfer_callwas invisible on the call detail page even though the transfer fired. (Screenshot: single-prompt agent showing atransfer_callTool Call event — crew agents produce none.)Root cause
Crew tools run inside the deployed pod. The
ToolRegistryexecuted them silently and emitted nothing. Single-prompt agents show tool calls because the platform LLM emitstool_call_*events; crew tools are invisible to the platform.The rest of the pipeline already exists: pipecat's
agent_log_routermapsagent.logevents namedtool_call_start/end/error→ platformTOOL_CALL_*events,on_agent_logis wired for crew agents (AgentSDKProcessor), and/eventsallowlists + ClickHouse-persists them. The only missing link was the SDK emitting them.Fix (SDK-only, no pipecat/atoms change)
ToolRegistry.discover(self)now captures the owning crew node._execute_singleemitsSDKAgentLogEvent(name=tool_call_start|tool_call_end|tool_call_error)over the node's websocket around each tool, with{turn_id, tool_call_id, function_name, context:{arguments, response}, latency, success}.Zero change to user crew code —
transfer_calland every other@function_toolget Events-tab parity with single-prompt agents as soon as a crew redeploys on this SDK.Tests
Success emits start+end (with response + latency), error emits start+error, standalone registry stays silent. ruff clean; crew suite (29) green. (crew module is excluded from CI mypy by repo config.)
Rollout
Needs a patch release (5.11.1) + crew redeploy to take effect (the pod pulls smallestai from PyPI). The customer's live crews should be redeployed after release.