Skip to content

[Bug]: JsonRpcTransport.get_card() returns stale basic card instead of extended card #605

@chaturvedakashamarendra

Description

@chaturvedakashamarendra

What happened?

Bug Description

The get_card() method in JsonRpcTransport has a critical bug where it returns a stale local variable instead of the updated extended card after fetching authenticated extended card data.

Steps to Reproduce

  1. Create JsonRpcTransport with a basic agent card that supports_authenticated_extended_card = True
  2. Call get_card() method
  3. Method fetches extended card from server but returns the original basic card

Expected Behavior

Method should return the newly fetched extended card with additional authentication capabilities.

Actual Behavior

Method returns the original basic card, missing extended authentication information.

Root Cause

  • Line 283: Local variable card captures initial agent card state
  • Line 314: self.agent_card is updated with new extended card from server
  • Line 427: Method incorrectly returns stale card instead of updated self.agent_card

Impact

  • Authentication flows may fail due to missing extended capabilities
  • Silent failure - no exceptions thrown, making it hard to detect
  • Callers receive incorrect card information

Proposed Solution

Change return statement from return card to return self.agent_card on line 427.

Environment

  • File: src/a2a/client/transports/jsonrpc.py
  • Method: JsonRpcTransport.get_card()
  • Line: 427

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions