GPTLiveModel: interrupting a turn while a tool is running leaves the call unanswered and the session stops replying
维护者通常 1 天内回复
@Li-john1021 已经在做这个了。
开始于 2026年10月9日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- ai, audio-video-rtc
调研方向
Start in the realtime generation task in livekit-agents/livekit/agents/voice/agent_activity.py (around lines 4608-4640), where interrupted turns commit only finished tool results, and trace how _backend_open_calls is populated and cleared. Follow the existing _interrupted_tool_output handoff path to see how an error output is produced. Done means an interrupted, still-running call receives exactly one output, function_tools_executed fires, and the session replies to the next question. Reproduce it with a delayed tool and session.interrupt(force=True) first.
由索引模型根据 Issue 内容生成。
描述
Bug Description
With GPTLiveModel, if session.interrupt() is called while the voice model is still speaking its filler and a delegated tool call is running, that call never gets an output. On an interrupted turn, the realtime generation task only commits results of tools that already finished (code). For the tool that is still running, no FunctionCallOutput is produced, function_tools_executed is not emitted, and no response.item.create is sent. The call stays in _backend_open_calls, and from then on the session does not reply to the user at all.
#6785 made every call get exactly one output, but this case (a tool still running when the turn is interrupted) is still left without one.
Expected Behavior
The call is answered when the interrupted turn drops it (for example with an error output, as _interrupted_tool_output does for a handoff), so the conversation can continue.
Reproduction Steps
async def lookup_fee(product: str) -> str:
await asyncio.sleep(8)
return "The renewal fee is 1,480 yen."
model = openai.realtime.GPTLiveModel(responses_options={"model": "gpt-6-luna"})
session = AgentSession(llm=model)
await session.start(agent=Agent(instructions="Always call lookup_fee for prices.",
tools=[function_tool(lookup_fee)]))
# ask a price question; 0.5 s after the tool starts, while the filler is still playing:
session.interrupt(force=True)
# ~20 s later, ask another question
In voice tests:
- interrupt during the filler while the tool runs: 4/4 runs never sent the tool output, and the second question got no reply (it was transcribed, but no server events came for ~35 s until close)
- interrupt after the filler (agent
thinking): 3/3 normal - interrupt a reply that has no tool call: 3/3 normal
- same as the first case, then send a
FunctionCallOutputfor the open call 3 s later: 3/3 recovered and the second question was answered
Operating System
Windows 11
Models Used
GPT-Live (gpt-live-1) with a Responses backend (gpt-6-luna)
Package Versions
livekit==1.1.18
livekit-agents==1.8.3
livekit-plugins-openai==1.8.3
python==3.13
The code path above is unchanged in 1.8.5.
Additional Context
Our app calls session.interrupt(force=True) from error recovery and before a SIP transfer, so this can leave a phone call silent. Sending an output for the open call ourselves after the interrupt works around it.
- 主要语言
- Python
- 星标
- 14.6k
- 派生
- 3.9k
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 228
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
livekit/agents 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
Assistant markup is stripped from chat history when expressive mode is off可能已有人在做 @ShivamSharma43 于 21 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hosts可能重新可做 @AbarnaaSree 于 61 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Support CPython 3.15 in livekit-local-inference可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 32/100
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4860 · 1 条评论 ·
维护者通常 1 天内回复
-
:bug: Bug
难度 2/5 1-3 小时 新手友好度 84/100
scikit-image/scikit-image#8377 ·
维护者通常 1 天内回复
-
Ingredient import validation accepts negative nutrient values and NaN可能已有人在做 @LukeSekai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
wger-project/wger#2564 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/ponymail-foal#351 ·
-
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 4 天内回复