fix: look for goals in steps rather than plans

small bugfix, we used to look for goals in plans, but they are part of
a plan.

ref: N25B-400
This commit is contained in:
Pim Hutting
2026-01-19 16:02:17 +01:00
parent 215bafe27f
commit 27f91150e1
2 changed files with 3 additions and 4 deletions

View File

@@ -198,9 +198,9 @@ class BDIProgramManager(BaseAgent):
:return: All goals within and including the given goal.
"""
goals: list[Goal] = [goal]
for plan in goal.plan:
if isinstance(plan, Goal):
goals.extend(BDIProgramManager._extract_goals_from_goal(plan))
for step in goal.plan.steps:
if isinstance(step, Goal):
goals.extend(BDIProgramManager._extract_goals_from_goal(step))
return goals
def _extract_current_goals(self) -> list[Goal]:

View File

@@ -336,7 +336,6 @@ class UserInterruptAgent(BaseAgent):
else:
self.logger.warning("Tried to send belief with unknown type")
return
belief = Belief(name=belief_name, arguments=None)
self.logger.debug(f"Sending belief to BDI Core: {belief_name}")
# Conditional norms are unachieved by removing the belief