fix(auth): Prevent duplicate OAuth prompts and fix tool resumption ma…#5985
Open
tonycoco wants to merge 2 commits into
Open
fix(auth): Prevent duplicate OAuth prompts and fix tool resumption ma…#5985tonycoco wants to merge 2 commits into
tonycoco wants to merge 2 commits into
Conversation
Collaborator
|
Response from ADK Triaging Agent Hello @tonycoco, thank you for submitting this PR to address the duplicate OAuth prompts and tool resumption mapping! To help reviewers understand and verify your changes more quickly, could you please update your PR description with the following details from our contribution guidelines:
This context is highly appreciated and helps us review your contribution more efficiently. Thank you! |
Collaborator
|
/adk-pr-analyze |
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
During workflow execution, if multiple tools or functions require authentication under the same OAuth credential config, the system prompts the user multiple times (duplicate auth events). Additionally, when resuming execution after the user provides authorization, the preprocessor failed to map which tools should be resumed due to strict function call ID checks, and raised
AttributeErroron mocked events lackingactionsproperties during test runs.Solution:
build_auth_request_event(located infunctions.py) to merge requests sharing the samecredential_key.event.actionsandrequested_auth_configproperties inauth_preprocessor.pywith defensivegetattr(..., None)checks, preventing test environment crashes.user:namespace prefix to credential keys in openapi'stool_auth_handler.pyto match the storage conventions.Testing Plan
All changes are fully verified using both pre-existing and newly added unit tests.
Unit Tests:
Summary of passed
pytestresults:Passed all 183 tests under
tests/unittests/auth/including tests for OAuth request preprocessing, mock resilience, and the newly addedtest_duplicate_auth_requests_are_deduplicated.Manual End-to-End (E2E) Tests:
To verify deduplication:
adk_request_credentialtool call.Checklist
Additional context
Formatting and linting checks were fully passed via
pre-commit run --files(utilizingpyinkandisort).