老师,first_pending_index 是None的情况不需要处理吗?first_pending_index 为None会是什么样的情况?还是说这个情况不会出现?
# 8.判断是否有未完成的步骤,如果有则执行更新
if first_pending_index is not None:
# 9.获取历史已完成的子步骤并更新
updated_steps = plan.steps[:first_pending_index]
updated_steps.extend(new_steps)
# 10.更新plan规划
plan.steps = updated_steps
# 11.返回规划更新事件
yield PlanEvent(plan=plan, status=PlanEventStatus.UPDATED)