fix(cli): remove shadowing local json import breaking A2A setup#6345
Open
AnayGarodia wants to merge 2 commits into
Open
fix(cli): remove shadowing local json import breaking A2A setup#6345AnayGarodia wants to merge 2 commits into
AnayGarodia wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
@googlebot I signed it! |
cbd1837 to
96765a5
Compare
Collaborator
|
Hi @AnayGarodia , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
Collaborator
|
Hi @wyf7107 , can you please review this. LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #6332
Running
adk api_server --a2a(orget_fast_api_app(..., a2a=True)) silently mounts no A2A routes. Thegemini_enterprise_app_nameblock near the end ofget_fast_api_apphas a redundant function-localimport json. Because of that local import,jsonis a local variable for the entire function, so the earlierjson.load(f)in the A2A discovery loop raisesUnboundLocalError: cannot access local variable 'json'. That exception is caught by the loop'sexcept Exception, logged as "Failed to setup A2A agent", and swallowed, so every A2A agent silently fails to register and no/a2a/...routes are added.jsonis already imported at module scope, so this removes the redundant local import. (The siblingimport inspectin that block is kept:inspectis not imported at module scope.)The existing A2A test only checks
/list-apps, so it passed despite the broken route mounting. The added regression test drivesget_fast_api_app(a2a=True)over a temp agent directory and asserts the A2A application is actually constructed (i.e. execution gets past thejson.loadcall). It fails onmainwith theUnboundLocalErrorpath and passes with this change; the existing A2A tests continue to pass.