@@ -144,6 +144,12 @@ def __init__( # noqa: PLR0913
144144 # asyncio tasks and to surface unexpected exceptions.
145145 self ._background_tasks = set ()
146146
147+ # TODO: Remove this property when we implement GetExtendedCard method in compat request handler.
148+ @property
149+ def agent_card (self ) -> AgentCard :
150+ """The core agent card to serve logic against."""
151+ return self ._agent_card
152+
147153 @validate_request_params
148154 async def on_get_task (
149155 self ,
@@ -684,11 +690,6 @@ async def on_delete_task_push_notification_config(
684690 lambda self : self ._agent_card .capabilities .extended_agent_card ,
685691 error_message = 'The agent does not support authenticated extended cards' ,
686692 )
687- @validate (
688- lambda self : self .extended_agent_card ,
689- error_message = 'The agent does not have an extended agent card configured' ,
690- error_type = ExtendedAgentCardNotConfiguredError ,
691- )
692693 async def on_get_extended_agent_card (
693694 self ,
694695 params : GetExtendedAgentCardRequest ,
@@ -698,6 +699,9 @@ async def on_get_extended_agent_card(
698699
699700 Requires `capabilities.extended_agent_card` to be true.
700701 """
702+ if not self .extended_agent_card :
703+ raise ExtendedAgentCardNotConfiguredError
704+
701705 extended_card = self .extended_agent_card
702706
703707 if self .extended_card_modifier :
0 commit comments