Skip to content

Fix: Handled AgentCardBuilder field inconsistencies#2099

Closed
SyedMohamedHyder wants to merge 6 commits intogoogle:mainfrom
SyedMohamedHyder:fix/AgentCardBuilder
Closed

Fix: Handled AgentCardBuilder field inconsistencies#2099
SyedMohamedHyder wants to merge 6 commits intogoogle:mainfrom
SyedMohamedHyder:fix/AgentCardBuilder

Conversation

@SyedMohamedHyder
Copy link

@SyedMohamedHyder SyedMohamedHyder commented Jul 22, 2025

Summary of Changes

This PR makes a few small improvements to the experimental Agent Card Builder feature:

  • Updated references to AgentCard and AgentSkill fields to use snake_case instead of camelCase, in line with the project's conventions.
  • Updated the doc_url field, which is not defined in the AgentCard model to documentation_url.
  • Adjusted related unit tests to reflect these updates.

Rationale

Although this feature is still experimental, these changes help improve consistency and clarity:

  1. Follows Model Conventions
    The models currently allow camelCase access only for backwards compatibility and issue a deprecation warning when used. These aliases are planned to be removed in version 0.3.0. Updating to snake_case ensures the code aligns with the intended usage and avoids deprecation warnings. Below is the corresponding code from a2a-sdk.
    def __getattr__(self, name: str) -> Any:
        """Allow getting attributes via their camelCase alias."""
        # Get the map and find the corresponding snake_case field name.
        field_name = type(self)._get_alias_map().get(name)  # noqa: SLF001

        if field_name:
            # An alias was used, issue a warning.
            warnings.warn(
                (
                    f"Accessing field '{name}' via its camelCase alias is deprecated and will be removed in version 0.3.0 "
                    f"Use the snake_case name '{field_name}' instead."
                ),
                DeprecationWarning,
                stacklevel=2,
            )

            # If an alias was used, retrieve the actual snake_case attribute.
            return getattr(self, field_name)

        # If it's not a known alias, it's a genuine missing attribute.
        raise AttributeError(
            f"'{type(self).__name__}' object has no attribute '{name}'"
        )
  1. Avoids Potential Issues
    Since doc_url isn’t a valid field on AgentCard, replacing it with documentation_url helps prevent confusion and ensures only supported fields are used.

I have also updated the unit tests to ensure they correctly reflect the current model structure and remain reliable over time.

These are relatively minor changes, but I hope they help keep the codebase clean and aligned with the project's direction. Feedback is always welcome.

@ankursharmas
Copy link
Collaborator

@seanzhou1023 Please help review.

@Kunmeer-SyedMohamedHyder

Hello @seanzhou1023! Sorry for bothering. Please have a look on this fix when you find some time!

@@ -198,10 +198,11 @@ async def test_build_with_custom_parameters(
assert result.description == "An ADK Agent" # Default description
# The source code uses doc_url parameter but AgentCard expects documentation_url
# Since the source code doesn't map doc_url to documentation_url, it will be None
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you update this comment as well?

@rohityan rohityan self-assigned this Dec 4, 2025
@rohityan rohityan added a2a [Component] This issue is related a2a support inside ADK. request clarification [Status] The maintainer need clarification or more information from the author labels Dec 4, 2025
@rohityan
Copy link
Collaborator

rohityan commented Dec 4, 2025

Hi @SyedMohamedHyder ,Thank you for your contribution!
Before we can proceed can you fix the failing unit tests.
You can fix the lint errors using autoformat.sh.

@rohityan rohityan added agent config [Component] This issue is related to the Agent Config interface and implementation and removed a2a [Component] This issue is related a2a support inside ADK. labels Dec 4, 2025
@rohityan
Copy link
Collaborator

Hi @SyedMohamedHyder , I am closing this pull request for now due to the lack of recent updates regarding the requested changes. Please feel free to reopen this (or submit a new PR) once you have had a chance to address the feedback.
Thank you for your contribution.

@rohityan rohityan closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent config [Component] This issue is related to the Agent Config interface and implementation request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants