优化ActionPlanner类中的时间戳更新逻辑,确保在成功执行计划后再更新last_obs_time_mark,以提高消息判断的准确性。

This commit is contained in:
minecraft1024a
2025-08-14 17:57:01 +08:00
parent d5777c2980
commit b82bb30095

View File

@@ -245,8 +245,6 @@ class ActionPlanner:
"is_parallel": is_parallel,
}
# 只有在成功完成决策后才更新已读时间戳,确保新消息判断的准确性
self.last_obs_time_mark = time.time()
return (
{
@@ -296,6 +294,8 @@ class ActionPlanner:
actions_before_now_block = f"你刚刚选择并执行过的action是\n{actions_before_now_block}"
# 注意不在这里更新last_obs_time_mark应该在plan成功后再更新避免异常情况下错误更新时间戳
self.last_obs_time_mark = time.time()
if mode == ChatMode.FOCUS:
mentioned_bonus = ""