Skip to content

Commit b0d07a9

Browse files
committed
fix:兼容处理中增加warning日志
1 parent b50d5bb commit b0d07a9

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

astrbot/core/agent/runners/tool_loop_agent_runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ async def step(self):
517517
logger.warning(
518518
"LLM returned empty assistant message with no tool calls."
519519
)
520+
# 若所有fallback使用完毕后依然为空回复 则显示执行报错 避免静默
521+
raise RuntimeError("LLM returned empty assistant message with no tool calls.")
522+
520523
self.run_context.messages.append(Message(role="assistant", content=parts))
521524

522525
# call the on_agent_done hook

astrbot/core/provider/sources/openai_source.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ async def _query_stream(
316316
continue
317317
for tool_call in choice.delta.tool_calls:
318318
if hasattr(tool_call, "type") and tool_call.type in (None, ""):
319+
logger.warning(f"tool_call.type is empty, manually set to 'function'")
319320
tool_call.type = "function"
320321

321322
try:

0 commit comments

Comments
 (0)