chore(DATAGO-124643): Order agent card display names in alphabetical order #998
+282
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




What is the purpose of this change?
Implements alphabetical sorting for agent cards returned by the
/api/v1/agentCardsendpoint. This ensures that agent dropdowns and lists in the frontend display agents in a consistent, user-friendly alphabetical order based on their display names.How was this change implemented?
Backend Changes:
src/solace_agent_mesh/gateway/http_sse/routers/agent_cards.pyDISPLAY_NAME_EXTENSION_URIconstant for the display name extension_get_agent_display_name()helper function to extract display names from agent card extensions, falling back to agent name if not presentTest Assets:
examples/agents/test_sorting_agents.yamlwith 12 test agents featuring diverse display names (numbers, emojis, special characters, mixed case) for manual testingtests/integration/apis/test_agent_cards_sorting.pyintegration test covering 20 edge cases including:Key Design Decisions
.lower()for case-insensitive comparison, so "Apple Agent" and "ALPHA AGENT" sort logically togetherHow was this change tested?
test_agent_cards_endpoint_returns_alphabetically_sorted_agentstests the full flow: creates test agents → registers in agent registry → calls API endpoint → verifies alphabetical orderexamples/agents/test_sorting_agents.yamlwith 12 sample agents for visual verification in the frontendIs there anything the reviewers should focus on/be aware of?
_sorts before letters, emojis sort after ASCII)AgentRegistryinstance rather than using a fixture, as theWebUIBackendFactorydoesn't pre-configure an agent registry - reviewers should verify this approach aligns with testing patternshttps://solace.com/a2a/extensions/display-nameextension; agents without this extension fall back to using their internalnamefieldReferences
Default agent in Projects
Agent selection in Chat