Skip to content

Method with AchieveGoal annotation but without an Action annotation is not throwing the expected exception #1796

Description

@deleSerna

Issue
According to the doc , AchievesGoal annotation should be applied to only methods with an Action annotation. But if you define a method Annotated with AchievesGoal but not with Action in an Agent as shown below.
@AchievesGoal(description = "A reviewed vegetarian dish") public Dish verifyTheDish(Dish input, Ai ai) {.. }
Then eventually, you can see message like SimpleAgentProcess - 🛑 Process recursing_swirles has no goals: [] but it should have been a proper that reports the root cause AchievesGoal on a non Action method.

How to fix

  • Add a very early check for the annotation in AgentMetadataReader.kt
  • If that check is added just remove the following check as it will become redundant with the above check.
    // Find the goal action (the action with @AchievesGoal) if (goalActions.isEmpty()) { logger.warn( "SUPERVISOR planner requires at least one @AchievesGoal action on {}", targetType.name, ) return null }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions