@@ -3283,6 +3283,119 @@ def test_is_conversational_false_by_default(self):
32833283 assert config .is_conversational is False
32843284
32853285
3286+ class TestAgentDefinitionIsCaseManager :
3287+ """Tests for AgentDefinition.is_case_manager property."""
3288+
3289+ def test_is_case_manager_true_when_metadata_set (self ):
3290+ """Returns True when metadata.is_case_manager is True."""
3291+ json_data = {
3292+ "id" : "test-case-manager" ,
3293+ "name" : "Case Manager Agent" ,
3294+ "version" : "1.0.0" ,
3295+ "metadata" : {
3296+ "isConversational" : False ,
3297+ "isCaseManager" : True ,
3298+ "storageVersion" : "1.0.0" ,
3299+ },
3300+ "settings" : {
3301+ "model" : "gpt-4o" ,
3302+ "maxTokens" : 4096 ,
3303+ "temperature" : 0 ,
3304+ "engine" : "basic-v1" ,
3305+ },
3306+ "inputSchema" : {"type" : "object" , "properties" : {}},
3307+ "outputSchema" : {"type" : "object" , "properties" : {}},
3308+ "resources" : [],
3309+ "messages" : [
3310+ {"role" : "system" , "content" : "You are a case manager agent." }
3311+ ],
3312+ }
3313+
3314+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3315+ json_data
3316+ )
3317+
3318+ assert config .is_case_manager is True
3319+
3320+ def test_is_case_manager_false_when_metadata_set_false (self ):
3321+ """Returns False when metadata.is_case_manager is False."""
3322+ json_data = {
3323+ "id" : "test-non-case-manager" ,
3324+ "name" : "Regular Agent" ,
3325+ "version" : "1.0.0" ,
3326+ "metadata" : {
3327+ "isConversational" : False ,
3328+ "isCaseManager" : False ,
3329+ "storageVersion" : "1.0.0" ,
3330+ },
3331+ "settings" : {
3332+ "model" : "gpt-4o" ,
3333+ "maxTokens" : 4096 ,
3334+ "temperature" : 0 ,
3335+ "engine" : "basic-v1" ,
3336+ },
3337+ "inputSchema" : {"type" : "object" , "properties" : {}},
3338+ "outputSchema" : {"type" : "object" , "properties" : {}},
3339+ "resources" : [],
3340+ "messages" : [{"role" : "system" , "content" : "You are an agent." }],
3341+ }
3342+
3343+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3344+ json_data
3345+ )
3346+
3347+ assert config .is_case_manager is False
3348+
3349+ def test_is_case_manager_false_when_not_in_metadata (self ):
3350+ """Returns False when isCaseManager is not present in metadata."""
3351+ json_data = {
3352+ "id" : "test-no-case-manager-field" ,
3353+ "name" : "Agent Without CM Field" ,
3354+ "version" : "1.0.0" ,
3355+ "metadata" : {"isConversational" : False , "storageVersion" : "1.0.0" },
3356+ "settings" : {
3357+ "model" : "gpt-4o" ,
3358+ "maxTokens" : 4096 ,
3359+ "temperature" : 0 ,
3360+ "engine" : "basic-v1" ,
3361+ },
3362+ "inputSchema" : {"type" : "object" , "properties" : {}},
3363+ "outputSchema" : {"type" : "object" , "properties" : {}},
3364+ "resources" : [],
3365+ "messages" : [{"role" : "system" , "content" : "You are an agent." }],
3366+ }
3367+
3368+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3369+ json_data
3370+ )
3371+
3372+ assert config .is_case_manager is False
3373+
3374+ def test_is_case_manager_false_when_no_metadata (self ):
3375+ """Returns False when agent has no metadata."""
3376+ json_data = {
3377+ "id" : "test-no-metadata" ,
3378+ "name" : "Agent Without Metadata" ,
3379+ "version" : "1.0.0" ,
3380+ "settings" : {
3381+ "model" : "gpt-4o" ,
3382+ "maxTokens" : 4096 ,
3383+ "temperature" : 0 ,
3384+ "engine" : "basic-v1" ,
3385+ },
3386+ "inputSchema" : {"type" : "object" , "properties" : {}},
3387+ "outputSchema" : {"type" : "object" , "properties" : {}},
3388+ "resources" : [],
3389+ "messages" : [{"role" : "system" , "content" : "You are an agent." }],
3390+ }
3391+
3392+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3393+ json_data
3394+ )
3395+
3396+ assert config .is_case_manager is False
3397+
3398+
32863399class TestAgentBuilderConfigResources :
32873400 """Tests for AgentDefinition resource configuration parsing."""
32883401
0 commit comments