Skip to content

Commit 905637f

Browse files
committed
Re-add accidently removed method and other minor fixes
1 parent b109114 commit 905637f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/a2a/server/apps/jsonrpc/fastapi_app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
AGENT_CARD_WELL_KNOWN_PATH,
1818
DEFAULT_RPC_URL,
1919
EXTENDED_AGENT_CARD_PATH,
20+
PREV_AGENT_CARD_WELL_KNOWN_PATH,
2021
)
2122

2223

@@ -102,6 +103,12 @@ def add_routes_to_app(
102103
)(self._handle_requests)
103104
app.get(agent_card_url)(self._handle_get_agent_card)
104105

106+
if agent_card_url == AGENT_CARD_WELL_KNOWN_PATH:
107+
# For backward compatibility, serve the agent card at the deprecated path as well.
108+
app.get(PREV_AGENT_CARD_WELL_KNOWN_PATH)(
109+
self._handle_get_agent_card
110+
)
111+
105112
if self.agent_card.supports_authenticated_extended_card:
106113
app.get(extended_agent_card_url)(
107114
self._handle_get_authenticated_extended_agent_card

tests/server/request_handlers/test_grpc_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async def test_get_agent_card_with_modifier(
210210
"""Test GetAgentCard call with a card_modifier."""
211211

212212
def modifier(card: types.AgentCard) -> types.AgentCard:
213-
modified_card = card.model_copy()
213+
modified_card = card.model_copy(deep=True)
214214
modified_card.name = 'Modified gRPC Agent'
215215
return modified_card
216216

tests/server/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def test_authenticated_extended_agent_card_endpoint_supported_with_specific_exte
228228
agent_card.supports_authenticated_extended_card = (
229229
True # Main card must support it
230230
)
231-
print(agent_card)
231+
232232
app_instance = A2AStarletteApplication(
233233
agent_card, handler, extended_agent_card=extended_agent_card_fixture
234234
)

0 commit comments

Comments
 (0)