jolly-eve-3916
08/06/2025, 8:13 PMtall-airline-16756
08/06/2025, 8:13 PMtall-airline-16756
08/06/2025, 8:14 PM@ctx.room.local_participant.register_rpc_method("start_turn")
async def start_turn(data: rtc.RpcInvocationData):
<http://logger.info|logger.info>("PTT RPC CALLED: start_turn")
Verify that the RpcInvocationData
payload is correctly parsed and handled.
1. AgentDispatchClient Interference: The AgentDispatchClient
does not interfere with RPC routing. It manages agent dispatches separately from RPC operations.
2. Enabling RPC Protocol Debugging:
• Set the LIVEKIT_EVALS_VERBOSE
environment variable to 1
for detailed logging.
• Adjust the logging level to DEBUG
in your agent code:
import logging
logging.basicConfig(level=logging.DEBUG)
• Include detailed logging in your RPC handlers to capture incoming calls and responses.
1. Additional Configuration for Python Agents: Python agents do not require additional configuration for RPC compared to the TypeScript SDK. Ensure that all handlers are registered and that the agent is connected to the correct room.
If the issue persists, enabling verbose logging and reviewing the logs for dropped messages or errors would be the next step. Let me know if you need further assistance!
Sources: Remote method calls (RPC) | LiveKit Docs | livekit-rtc/livekit/rtc/_proto/ffi_pb2.py | examples/agent-dispatch/index.ts | README.md | Dispatching agents | LiveKit Docsjolly-eve-3916
08/07/2025, 1:27 AMtall-airline-16756
08/07/2025, 1:29 AMreadyState
of the DataChannel can help spot these silent failures. 2. Are there known issues with RPC through Expo tunnel that don't affect audio? - There aren’t any well-known issues specifically affecting RPC over the Expo tunnel. That said, Expo’s tunnel mode might introduce some latency or connectivity hiccups that could mess with RPC calls. Audio streaming tends to be more resilient here since it uses a different transport. 3. Is there a specific order of operations or timing requirement for RPC registration? - Yes! RPC methods should be registered only after the session has started and the local participant is fully initialized. Make sure you call the agent’s local_participant.register_rpc_method
after session.start()
has finished. 4. Could DataChannel initialization be failing silently while audio tracks work normally? - Absolutely, this can happen. DataChannel might fail to initialize without any obvious errors, while audio keeps flowing smoothly. To troubleshoot, watch the readyState
of the DataChannel — if it’s anything other than open
, the channel hasn’t initialized properly. ### Debugging Suggestions: - Turn on verbose logging (LIVEKIT_EVALS_VERBOSE=1
) and check that your agent logs show DataChannel state changes. - Double-check that your client and agent SDK versions and configurations match up. - Try running RPC outside of Expo tunnel mode to see if the tunnel is causing the problem. Feel free to reach out if you want to dive deeper or need more help with debugging! Sources: packages/livekit-rtc/README.md | livekit-android-test/src/test/java/io/livekit/android/rpc/RpcMockE2ETest.kt | android/src/main/java/io/livekit/reactnative/expo/LiveKitApplicationLifecyc... | package-lock.json | Bringing AI avatars to voice agents