Skip to content

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

@ShishirRmc

Description

@ShishirRmc

What happened?

The get_card() method in JsonRpcTransport returns the wrong card when fetching an authenticated extended card. It returns the old card instead of the newly fetched one.

The Problem is that when an authenticated extended card is fetched, the method:
Correctly fetches the extended card from server
Correctly updates self.agent_card = response.root.result
❌ Incorrectly returns the OLD card variable

this is the section where it has issue:

https://github.com/ShishirRmc/a2a-python/blob/051ab20c395daa2807b0233cf1c53493e41b60c2/src/a2a/client/transports/jsonrpc.py#L338-L377

evidence: https://github.com/ShishirRmc/a2a-python/blob/051ab20c395daa2807b0233cf1c53493e41b60c2/src/a2a/client/transports/rest.py#L358-L361

The issue Defeats the entire purpose of fetching authenticated extended cards.
I have a one line fix ready and can submit a PR if you'd like.

Relevant log output

No runtime logs available, this is a code logic bug found through static analysis.

The method updates self.agent_card with the new extended card but returns 
the stale 'card' variable instead. This is inconsistent with RestTransport's 
correct implementation.

Code of Conduct

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions