优化决策后时间戳更新逻辑,确保新消息判断的准确性

This commit is contained in:
minecraft1024a
2025-08-13 18:49:45 +08:00
parent 0e7ebffb8f
commit f071345bbc

View File

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