Skip to content

Configure exit policy of AgentValidationManager using a property - #1801

Open
deleSerna wants to merge 7 commits into
embabel:mainfrom
deleSerna:ghissue-1796
Open

Configure exit policy of AgentValidationManager using a property#1801
deleSerna wants to merge 7 commits into
embabel:mainfrom
deleSerna:ghissue-1796

Conversation

@deleSerna

@deleSerna deleSerna commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Issue - #1796

Context - Currently, we are not consistently handling whenever an Agent is failing to adhere to a valid structure ( annotated properly, parameters and return type as expected etc..). In some cases, we are skipping such agent and in some cases, we are just logging a message.

Solution

  • Configure exit policy of such invalid cases by a property. By default, it just logs.
  • Add a new check to handle a method with AchieveGoal annotation but without an Action annotation
  • Test added for both failure cases and a successful case.

@alexheifetz

Copy link
Copy Markdown
Contributor

@deleSerna please confirm this PR is for Embabel 1.5.0 release vs 1.0.1
I will create labels rel-1.5.0 and rel-1.0.x for clarity

@igordayen igordayen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deleSerna - thank you for your contribution, left few comments. Also: how does this check correlate with generic Agent validation method. thanks

@igordayen igordayen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deleSerna - could you please consider aligning with:
src/main/kotlin/com/embabel/agent/spi/validation
thanks
@azanux - FYI

@igordayen

Copy link
Copy Markdown
Contributor

@deleSerna - build failed; expected failure?

[ERROR] com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected -- Time elapsed: 0.007 s <<< FAILURE!
org.opentest4j.AssertionFailedError: No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@71fdc611, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
	at com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected(VoidAchievesGoalJavaTest.java:37)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR] com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected
[ERROR]   Run 1: VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected:37 No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@4652404f, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
[ERROR]   Run 2: VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected:37 No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@71fdc611, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
[INFO] 
[INFO] 
[ERROR] Tests run: 3924, Failures: 1, Errors: 0, Skipped: 23
[INFO] 

@deleSerna

Copy link
Copy Markdown
Contributor Author

please confirm this PR is for Embabel 1.5.0 release vs 1.0.1
@alexheifetz It should be for both. I have created the PR based on main. Could you let me know the exact process I should follow here ?

@deleSerna

Copy link
Copy Markdown
Contributor Author

could you please consider aligning with:
src/main/kotlin/com/embabel/agent/spi/validation

@igordayen Could you clarify what do you meant by this? Move the check to DefaultAgentStructureValidator and get called as part of agentValidationManager.validate?

@igordayen

Copy link
Copy Markdown
Contributor

please confirm this PR is for Embabel 1.5.0 release vs 1.0.1
@alexheifetz It should be for both. I have created the PR based on main. Could you let me know the exact process I should follow here ?

https://github.com/embabel/embabel-agent/wiki/Working-with-Multiple-Releases

@deleSerna

Copy link
Copy Markdown
Contributor Author

build failed; expected failure?

I will check. Since both tests around the same criteria, may be VoidAchievesGoalJavaTest need an update . I will check it tomorrow.

@deleSerna

Copy link
Copy Markdown
Contributor Author

bug on 1.0.x - to be committed into main too

@igordayen In my case, should I just need to target to 1.0.x and would whoever merging the PR will take care of committing that to 1.5.0 and main?
Btw, why the branch name is 1.5.0, looks like a sudden jump from 1.0.x. ?

@igordayen

Copy link
Copy Markdown
Contributor

bug on 1.0.x - to be committed into main too

@igordayen In my case, should I just need to target to 1.0.x and would whoever merging the PR will take care of committing that to 1.5.0 and main? Btw, why the branch name is 1.5.0, looks like a sudden jump from 1.0.x. ?

@deleSerna it us actually developer responsibility to commit to both branches, if required. 1.5.0 - is actually "main" branch, thanks

@igordayen

Copy link
Copy Markdown
Contributor

could you please consider aligning with:
src/main/kotlin/com/embabel/agent/spi/validation

@igordayen Could you clarify what do you meant by this? Move the check to DefaultAgentStructureValidator and get called as part of agentValidationManager.validate?

Yes, ideally validation to be aligned with existing package structure and good reason why it can not be incorporated into agent structure validation. Thank you.

@deleSerna

Copy link
Copy Markdown
Contributor Author

@deleSerna - build failed; expected failure?

[ERROR] com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected -- Time elapsed: 0.007 s <<< FAILURE!
org.opentest4j.AssertionFailedError: No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@71fdc611, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
	at com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected(VoidAchievesGoalJavaTest.java:37)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR] com.embabel.agent.api.annotation.support.VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected
[ERROR]   Run 1: VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected:37 No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@4652404f, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
[ERROR]   Run 2: VoidAchievesGoalJavaTest.voidActionWithAchievesGoalIsRejected:37 No goal should be created for an @AchievesGoal method returning void: [Goal(name=com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, description=Consume a frog, pre=[hasRun_com.embabel.agent.api.annotation.support.VoidGoalAgent.consumeFrog, it:com.embabel.agent.api.dsl.Frog, it:void], inputs=[IoBinding(value=it:void)], outputType=JvmType(className=void), value=com.embabel.agent.api.annotation.support.AgentMetadataReader$$Lambda/0x00007f84a87b4620@71fdc611, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[])), Goal(name=Nirvana, description=Nirvana: Nothing more to do, pre=[__unobtanium__], inputs=[], outputType=null, value=com.embabel.agent.core.Goal$$Lambda/0x00007f84a8a57b80@187da86e, tags=[], examples=[], export=Export(name=null, remote=false, local=true, startingInputTypes=[]))] ==> expected: <true> but was: <false>
[INFO] 
[INFO] 
[ERROR] Tests run: 3924, Failures: 1, Errors: 0, Skipped: 23
[INFO] 

Understood, why it's failed. I have wrongly interpreted that only plan type with PlannerType.needsGoals will only have goal and hence put the check only for those plan types and this particular test was using plan type is utility. That's why it failed.
Obviously, I was wrong here. will fix it.

@deleSerna

Copy link
Copy Markdown
Contributor Author

good reason why it can not be incorporated into agent structure validation.

We don't fail on them at the moment.
IMO, this one should fail as it's a spec violation and therefore should not want to put it there.

On the other hand, IMO, there is no point in a validation failure that would not result in actual failure as people simply won't notice such warnings.

I can create a separate ticket for this and then decide in which branch that should go.
IMO, there are so many adhoc failures in the AgentMetadataReader that could fit in as part of AgentValidationManager but some of the verification is happening too late in AgentMetadataReader IMO. Maybe we have to split that in to two phases like - pre and post verification. But as mentioned above, IMO that should not be part of this PR.
what do you think?

@igordayen

Copy link
Copy Markdown
Contributor

@deleSerna, may I suggest creating an AchievableGoalValidator in a package with existing Agent Validators and employing it?
Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(!method.returnType.isInterface || !requireInterfaceDeserializationAnnotations || hasRequiredJsonDeserializeAnnotationOnInterfaceReturnType(
@igordayen Do you know why are we checking this for a method to considered as Action so that I can document accordingly.

@igordayen igordayen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deleSerna - more comments added. more leaning to configurable policy. complex conditions require proper documentation, i would suggest.
PR is having conflicts too.
Thank you

requireInterfaceDeserializationAnnotations : Boolean,
): Boolean {
return method.isAnnotationPresent(Action::class.java) &&
(agentClass.declaredMethods.contains(method) || isMethodFromSupertype(method, agentClass)) &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not easy to read without comments

/**
* Returns true, if the given method is declared in its super type.
*/
fun isMethodFromSupertype(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think spring has a utility for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not seen a direct equivalent of this in org.springframework.util.ClassUtils. Do you know which one are you referring here?

@deleSerna

Copy link
Copy Markdown
Contributor Author

more leaning to configurable policy
As I mentioned in the other thread, IMO, this is a spec violation and it is fixable within the Agent itself. Therefore, IMO, we should just fail here.
Do you still think exit condition for this violation should still be configurable via policy?

@igordayen

Copy link
Copy Markdown
Contributor

IMO, we should just fail here.
Do you still think exit condition for this violation should still be configurable via policy?

For multi-agent deployment, single-agent failure should not block server bootstrapping, my thinking

@deleSerna

Copy link
Copy Markdown
Contributor Author

For multi-agent deployment, single-agent failure should not block server bootstrapping, my thinking

But there are other validation errors already for which already fail. eg: here . Do you think this violation is different from those ones?

@igordayen

Copy link
Copy Markdown
Contributor

For multi-agent deployment, single-agent failure should not block server bootstrapping, my thinking

But there are other validation errors already for which already fail. eg: here . Do you think this violation is different from those ones?

==> Could you please document the behavior in English, in your own words? Thanks.

Related to goals dup too, looping @tuannx

@deleSerna

Copy link
Copy Markdown
Contributor Author

Could you please document the behavior in English, in your own words? Thanks.
Sorry for not being clear.
I meant that there is precedence of returning null to block server boot strapping when validation of single agent is failing.
For example, here and here.

Therefore, IMO, we could also return null and fail here as this validation error is similar to the cases I mentioned above.
what do you think?

@igordayen

Copy link
Copy Markdown
Contributor

Therefore, IMO, we could also return null and fail here as this validation error is similar to the cases I mentioned above. what do you think?

Please compile full documentation on known agent validators behavior for consistency. Thanks

@igordayen

Copy link
Copy Markdown
Contributor

@deleSerna - please see conflicts. And- what is more important - per analysis, deployments should not be rejected. Thanks

@deleSerna

Copy link
Copy Markdown
Contributor Author

please see conflicts

@igordayen Sure, I could fix the conflicts. As there are multiple PRs around the similar topic (#1833 ), I am a bit confused how to proceed further here. Could you please clarify which one among the below path should follow?

  1. Do you want to see exit policy of all configuration mistakes reported here in , decide by an user configured exit policy?
    OR
  2. Only for new error introduced by this PR and in fix(core): log an error when a duplicate name silently drops a goal, action or tool #1833?

@igordayen

Copy link
Copy Markdown
Contributor

@deleSerna - please see the in-depth discussion here:

#1834 (comment)

Thank you.

@deleSerna

Copy link
Copy Markdown
Contributor Author

per analysis, deployments should not be rejected.

No that is not true. For some structure violation, we are still failing. See AgentMetadataReader.kt#L218

       if (actionMethods.isEmpty() && goals.isEmpty() && conditionMethods.isEmpty()) {
            logger.warn(
                "❓No methods annotated with @{} or @{} and no goals defined on {}",
                Action::class.simpleName,
                Condition::class.simpleName,
                targetType.name,
            )
            return null
        }

I would argue that AchievesGoal missing Action is a spec violation and we should just stop the agent. @igordayen Do you disagree with that?

@igordayen

Copy link
Copy Markdown
Contributor

per analysis, deployments should not be rejected.

No that is not true. For some structure violation, we are still failing. See AgentMetadataReader.kt#L218

       if (actionMethods.isEmpty() && goals.isEmpty() && conditionMethods.isEmpty()) {
            logger.warn(
                "❓No methods annotated with @{} or @{} and no goals defined on {}",
                Action::class.simpleName,
                Condition::class.simpleName,
                targetType.name,
            )
            return null
        }

I would argue that AchievesGoal missing Action is a spec violation and we should just stop the agent. @igordayen Do you disagree with that?

==> thanks @deleSerna , @tuannx - missing in your analysis? thanks

@tuannx

tuannx commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

per analysis, deployments should not be rejected.

No that is not true. For some structure violation, we are still failing. See AgentMetadataReader.kt#L218

       if (actionMethods.isEmpty() && goals.isEmpty() && conditionMethods.isEmpty()) {
            logger.warn(
                "❓No methods annotated with @{} or @{} and no goals defined on {}",
                Action::class.simpleName,
                Condition::class.simpleName,
                targetType.name,
            )
            return null
        }

I would argue that AchievesGoal missing Action is a spec violation and we should just stop the agent. @igordayen Do you disagree with that?

==> thanks @deleSerna , @tuannx - missing in your analysis? thanks

@deleSerna @alexheifetz I've just verified:

What createAgentMetadata returning null actually does

AgentMetadataReader.createAgentMetadata returns AgentScope?. It has three callers, and
each treats null differently.

Caller Line On null Effect
AgentScanningPostProcessorDelegate AutoRegistration.kt:57-70 if (agentMetadata != null), then return bean Agent is skipped, the application boots normally. This is the Spring path
SingleInstanceAgentScopeBuilder AgentScopeBuilder.kt:59-60 ?: throw IllegalArgumentException Throws while building the scope
FromInstancesAgentScopeBuilder AgentScopeBuilder.kt:71-72 ?: throw IllegalArgumentException Throws while building the scope
RunSubagent.handle RunSubagent.kt:35 ... as Agent — unchecked cast on a nullable NullPointerException at runtime, mid-action

The deciding lines are in AutoRegistration.kt:

val agentMetadata = agentMetadataReader.createAgentMetadata(bean)   // :57
if (agentMetadata != null) {                                        // :58
    ...
    agentPlatform.deploy(agentMetadata)                             // :67
}
return bean                                                          // :70

return bean sits outside the if, so the bean is handed back to Spring and the context
finishes refreshing. return null has never blocked bootstrapping. It skips one agent
and the application starts with that capability missing.

Two more drop a goal rather than the agent, so the agent still deploys:

Line Condition Log level
444 @AchievesGoal method returns void ERROR
713 @AchievesGoal method returns void ERROR

Summary

In this codebase "rejecting an agent" has never meant stopping the server. It means quietly
doing less. Seven conditions already end that way, and the only thing that varies between
them is the log level — DEBUG, WARN or ERROR — chosen without an evident rule.

The same return null is benign on the Spring path, an IllegalArgumentException when
building a scope, and a NullPointerException at runtime under RunSubagent.

@deleSerna

Copy link
Copy Markdown
Contributor Author

I would argue that AchievesGoal missing Action is a spec violation and we should just stop the agent

@tuannx @igordayen Agree that wording stop the agent used by me is a bit confusing. I meant return NULL in AgentMetaReader as similar to the actionMethods.isEmpty() && goals.isEmpty() && conditionMethods.isEmpty() check, not just log ERROR. (Only in the context of AchievesGoal missing Action annotation. not related to #1833)

@igordayen

Copy link
Copy Markdown
Contributor

Summarizing - please correct if required:
A validation failure is flagged as an ERROR for the agent to continue deployment.
What is the concern with this behavior?
What to skip: Agent deployment in some cases. Do you have strong rationale for this?
@deleSerna @tuannx - please advise.
Thanks.

@deleSerna

Copy link
Copy Markdown
Contributor Author

A validation failure is flagged as an ERROR for the agent to continue deployment.
What is the concern with this behavior?

IMO, we should have been returning NULL in AgentMetaReader for the validation failure cases too.
My rationale for this is, as @tuannx analyzed, AgentValidationManager consists of GoapPathToCompletionValidator and it's doc says
Validator that checks whether an agent definition has at least one possible path from its initial conditions, through available actions, to achieve its defined goals.
Therefore, if it fails, then the GOAL is not reachable. Therefore, I do not understand the benefit of deploying the agent.

What to skip:

IMO, we should skip the agent

  • In all cases, where agent is not in ideal state due to mistakes that can be corrected by the developer. Eg: inaccurate annotations , return type etc. This will help the developer to notice this kind of mistakes sooner.
  • If planner has goals and goal is not achievable.

@igordayen

Copy link
Copy Markdown
Contributor

@deleSerna - if you're referring to the piece with bull commented out - and if this is the only place - then I would still think to go with configurability.

@tuannx FYI.

We need consensus on this.

Asking to link related issues.
Thanks.

@deleSerna

Copy link
Copy Markdown
Contributor Author

if you're referring to the piece with null commented out - and if this is the only place .

At present, AgentValidationManager and DefaultAgentValidationManager seem to be only used in AgentMetaDataReader other than tests. Therefore, ok to make it's behavior configure via configurable property.

DefaultAgentStructureValidator is @component therefore, user can explicitly inject that it won't be covered by the configurable property.

Would also like to see behavior of AchievableGoalValidator, introduced this in PR, to be controlled by the same configurable property?

@igordayen

Copy link
Copy Markdown
Contributor

I'm getting confused, as I thought it would be applied in a single place in the code, specifically where "null" gor commented out.
And all others should return Validation Code and Validation error.
thanks.

@deleSerna

Copy link
Copy Markdown
Contributor Author

as I thought it would be applied in a single place in the code, specifically where "null" gor commented out.

I can make AchievableGoalValidator part of AgentValidationManager and put it behind the configurable property.

But there are other checks in the AgentMetadadatReader that is not part of AgentValidationManager eg: line no 154, 164, 218, 232, 239 and 265

I was not planning to move those 6 checks behind the configurable property as it's a change in behavior.

Is this clear now?

Signed-off-by: deleSerna <nadeeshtv@gmail.com>
Signed-off-by: deleSerna <nadeeshtv@gmail.com>
Signed-off-by: deleSerna <nadeeshtv@gmail.com>
Signed-off-by: deleSerna <nadeeshtv@gmail.com>
@igordayen

Copy link
Copy Markdown
Contributor

But there are other checks in the AgentMetadadatReader that is not part of AgentValidationManager eg: line no 154, 164, 218, 232, 239 and 265

Thanks, @deleSerna - now 100% clear.
Perhaps in all places ==>

"null"==> skipAgentDeploymentIfRequired API, and inside it apply config check? At least the name is more suggestive than just 'null' in the very first place. And add a paragraph to adoc.

Signed-off-by: deleSerna <nadeeshtv@gmail.com>
return method.isAnnotationPresent(Action::class.java) &&
// declared in the given agent class, or in its super type?
(agentClass.declaredMethods.contains(method) || isMethodFromSupertype(method, agentClass)) &&
// TODO please fill after discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igordayen @alexheifetz I do not know what exactly meant by this condition . I have move dit from AgentMetadaReader. Could one of you help me in filling the TODO here?

(!method.returnType.isInterface || !requireInterfaceDeserializationAnnotations || hasRequiredJsonDeserializeAnnotationOnInterfaceReturnType(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deleSerna im offline today, seeing very substantial changes, and getting concerned. Will try to review code tomorrow . This week main focus on release 2.0.0 with remaining issues only due to spring ai upgrade. Thank you for understanding

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Signed-off-by: deleSerna <nadeeshtv@gmail.com>
Signed-off-by: deleSerna <nadeeshtv@gmail.com>
targetType.name,
)
return null
if (skipAgentDeploymentOnError) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igordayen Can you look into EmbabelMockitoIntegrationTestBlockingTest. It's failing because the it's not returning by default.
Looks likeAutoRegistration.kt can pick up any Bean and it's really depend on this check to not behind any condition.
Therefore, I am not putting return null behind property check.

@deleSerna deleSerna changed the title Add verification for AchievesGoal Configure exit policy of AgentValidationManager using a property Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants