[高] Agent _llm_invocations计数器在多次run()之间不重置 #84

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

问题描述

backend/app/agent_runtime/core.py 第112行初始化 _llm_invocations 为0,但第170行 run() 方法中未重置此计数器。同一 Agent 实例多次调用 run() 时,计数器累加导致 budget 提前耗尽。

涉及文件

  • backend/app/agent_runtime/core.py:112, 170

修复建议

在 run() 方法开始时重置 _llm_invocations = 0。

严重程度

高 - 资源控制逻辑错误

## 问题描述 backend/app/agent_runtime/core.py 第112行初始化 _llm_invocations 为0,但第170行 run() 方法中未重置此计数器。同一 Agent 实例多次调用 run() 时,计数器累加导致 budget 提前耗尽。 ## 涉及文件 - backend/app/agent_runtime/core.py:112, 170 ## 修复建议 在 run() 方法开始时重置 _llm_invocations = 0。 ## 严重程度 高 - 资源控制逻辑错误
admin closed this issue 2026-05-10 18:54:00 +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#84