fix: achieve goal if can't fail
This commit is contained in:
@@ -467,8 +467,7 @@ class AgentSpeakGenerator:
|
||||
:param main_goal: Whether this is a main goal (for UI notification purposes).
|
||||
"""
|
||||
context: list[AstExpression] = [self._astify(phase)]
|
||||
if goal.can_fail:
|
||||
context.append(~self._astify(goal, achieved=True))
|
||||
context.append(~self._astify(goal, achieved=True))
|
||||
if previous_goal and previous_goal.can_fail:
|
||||
context.append(self._astify(previous_goal, achieved=True))
|
||||
if not continues_response:
|
||||
@@ -489,7 +488,7 @@ class AgentSpeakGenerator:
|
||||
if isinstance(step, Goal):
|
||||
subgoals.append(step)
|
||||
|
||||
if not goal.can_fail and not continues_response:
|
||||
if not goal.can_fail:
|
||||
body.append(AstStatement(StatementType.ADD_BELIEF, self._astify(goal, achieved=True)))
|
||||
|
||||
if len(body) == 0:
|
||||
|
||||
Reference in New Issue
Block a user