Conversation
| pb_outputs = [ | ||
| agent_pb.FunctionCallOutput( | ||
| call_id=fco.call_id, | ||
| output=fco.output, | ||
| is_error=fco.is_error, | ||
| ) | ||
| for fco in event.function_call_outputs | ||
| ] |
There was a problem hiding this comment.
🔴 AttributeError crash when function_call_outputs contains None
FunctionToolsExecutedEvent.function_call_outputs is typed list[FunctionCallOutput | None] (see livekit-agents/livekit/agents/voice/events.py:162), but the list comprehension at lines 440-447 unconditionally accesses fco.call_id, fco.output, and fco.is_error without filtering out None entries. When any tool execution hasn't completed yet (output is None), this will raise AttributeError: 'NoneType' object has no attribute 'call_id', crashing the event handler and potentially dropping session events.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| async def _worker_run(worker: AgentServer) -> None: | ||
| try: | ||
| await server.run(devmode=args.devmode, unregistered=jupyter) | ||
|
|
||
| await server.run(devmode=devmode, unregistered=False) |
There was a problem hiding this comment.
🔴 Jupyter regression: _run_worker now runs with unregistered=False and devmode=False
The jupyter.py:133 calls cli._run_worker(server, args) where args.reload_addr is None. The new _run_worker at livekit-agents/livekit/agents/cli/cli.py:286 derives devmode = args.reload_addr is not None (evaluates to False) and hard-codes unregistered=False at line 309. The old code used devmode=args.devmode (True for jupyter) and unregistered=jupyter (True). This is a behavioral regression: (1) the worker now attempts to register with the LiveKit server over WebSocket which was not intended for jupyter's simulate_job workflow, and (2) devmode=False causes server.drain() to be called during shutdown (line 337), adding unnecessary delay.
(Refers to lines 286-309)
Prompt for agents
In livekit-agents/livekit/agents/cli/cli.py, the _run_worker function needs to support the jupyter use case again. The old code accepted a `jupyter: bool = False` parameter which: (1) set `unregistered=jupyter` when calling `server.run()` at line 309 so jupyter skipped WS registration, (2) set `devmode=args.devmode` which was True for jupyter instead of deriving it from reload_addr, and (3) skipped installing signal handlers in jupyter mode. Either re-add a parameter to _run_worker to control these, or update jupyter.py to use a different code path. Also update livekit-agents/livekit/agents/jupyter.py:130-133 to pass appropriate arguments.
Was this helpful? React with 👍 or 👎 to provide feedback.
No description provided.