[危急] Agent运行时崩溃: _inject_knowledge_context引用未定义变量db #67

Closed
opened 2026-05-10 18:39:03 +08:00 by admin · 0 comments
Owner

问题描述

backend/app/agent_runtime/core.py 第839行,_inject_knowledge_context 方法在 finally 块中引用了 db.close(),但 db 变量在该方法中从未定义。这是上一轮修复通知系统时引入的复制粘贴错误。该 Bug 导致所有 Agent 执行在知识注入阶段崩溃。

涉及文件

  • backend/app/agent_runtime/core.py:839

修复建议

删除 finally: if db: db.close() 代码块,该方法不涉及数据库操作。

严重程度

危急 - 所有 Agent 执行受影响

## 问题描述 backend/app/agent_runtime/core.py 第839行,_inject_knowledge_context 方法在 finally 块中引用了 db.close(),但 db 变量在该方法中从未定义。这是上一轮修复通知系统时引入的复制粘贴错误。该 Bug 导致所有 Agent 执行在知识注入阶段崩溃。 ## 涉及文件 - backend/app/agent_runtime/core.py:839 ## 修复建议 删除 finally: if db: db.close() 代码块,该方法不涉及数据库操作。 ## 严重程度 危急 - 所有 Agent 执行受影响
admin closed this issue 2026-05-10 18:46:29 +08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/aiagent#67