proud-match-31207
08/25/2025, 6:59 AM1.2.3 but same piece of code is again modified in 1.2.6
Changelog
1.2.3 - Fix RuntimeError on scheduling speech and on mark_generation_done by @jayeshp19 in #3032
1.2.6 - fix: check if scheduling_paused after on_user_turn_completed callback by @longcw in #3091I am looking to upgrade to 1.2.6 but what is the recommendation to handle these silent exceptions? Has anyone added a catchall exception in their code?
proud-match-31207
08/25/2025, 7:00 AMjolly-air-155
08/25/2025, 7:03 AMsession.say or session.generate_reply in on_user_turn_completed callbackproud-match-31207
08/25/2025, 8:51 AMException in callback AgentActivity._create_speech_task.\u003clocals\u003e._mark_done_if_needed(\u003cTask finishe...\u003e result=None\u003e) at /usr/local/lib/python3.11/site-packages/livekit/agents/voice/agent_activity.py:329\nhandle: \u003cHandle AgentActivity._create_speech_task.\u003clocals\u003e._mark_done_if_needed(\u003cTask finishe...\u003e result=None\u003e) at /usr/local/lib/python3.11/site-packages/livekit/agents/voice/agent_activity.py:329\u003e\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.11/asyncio/events.py\", line 84, in _run\n self._context.run(self._callback, *self._args)\n File \"/usr/local/lib/python3.11/site-packages/livekit/agents/voice/agent_activity.py\", line 331, in _mark_done_if_needed\n speech_handle._mark_done()\n File \"/usr/local/lib/python3.11/site-packages/livekit/agents/voice/speech_handle.py\", line 210, in _mark_done\n self._mark_generation_done()\n File \"/usr/local/lib/python3.11/site-packages/livekit/agents/voice/speech_handle.py\", line 201, in _mark_generation_done\n raise RuntimeError(\"cannot use mark_generation_done: no active generation is running.\")\nRuntimeError: cannot use mark_generation_done: no active generation is running.
@jolly-air-155 - Thanks for responding. This is the traceback I see. Are you saying the callback referred here is on_user_turn_completed callback and handling the exception in this callback should fix such issues?
Also the above exception is not sent to the code when it occurs, rather this exception is retrieved when closing the agent session. Is it expected?proud-match-31207
08/25/2025, 8:52 AMjolly-air-155
08/25/2025, 8:57 AM_mark_generation_done, it should be already fixed in https://github.com/livekit/agents/pull/3032/files, which version of agents are you using? can you share the result of pip list | grep livekit?jolly-air-155
08/25/2025, 8:58 AMproud-match-31207
08/25/2025, 8:59 AMError event in agent session. Is there a catchall exception I can add?jolly-air-155
08/25/2025, 9:05 AMproud-match-31207
08/25/2025, 9:39 AMrhythmic-flower-10210
09/10/2025, 9:03 AMproud-match-31207
09/10/2025, 9:06 AMrhythmic-flower-10210
09/10/2025, 9:21 AMrhythmic-flower-10210
09/10/2025, 9:33 AMaloof-table-88981
09/10/2025, 9:33 AMrhythmic-flower-10210
09/10/2025, 9:35 AM