fix: correct include_contents behavior in ADK web (fixes google#3535)#4492
fix: correct include_contents behavior in ADK web (fixes google#3535)#4492dalagadenilesh wants to merge 2 commits intogoogle:mainfrom
Conversation
Summary of ChangesHello @dalagadenilesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical bug in the ADK web application where the conversational context provided to a sub-agent after a transfer was incorrect, specifically lacking the most recent user input. The changes ensure that when control is passed to a sub-agent, its operational context is properly updated with the latest user interaction, thereby improving the accuracy and relevance of its responses. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix an issue where a sub-agent receives an incorrect context upon transfer. The proposed solution is to filter out 'transfer_to_agent' events when constructing the context for the current turn. The changes look good and align with the problem description. I've found one potential AttributeError in the new _is_direct_transfer function and suggested a fix. Please see the detailed comment. It would also be beneficial to add unit tests for the new _is_direct_transfer function to cover its logic and edge cases, such as when an event's content is None.
|
Response from ADK Triaging Agent Hello @dalagadenilesh, thank you for creating this PR! Could you please provide a testing plan and include logs or screenshots from your manual end-to-end testing? This information will help reviewers to review your PR more efficiently. Thanks! |
|
Response from ADK Triaging Agent Hello @dalagadenilesh, thank you for creating this PR! I've noticed a few things are missing from the PR description:
This information will help reviewers to review your PR more efficiently. Thanks! |
|
Response from ADK Triaging Agent Hello @dalagadenilesh, thank you for your contribution! To help us review this PR, could you please provide a more detailed testing plan? According to our contribution guidelines, we require the following for bug fixes:
You can find more details in our contribution guidelines. This information will help reviewers to verify the fix and review your PR more efficiently. Thanks! |
|
Response from ADK Triaging Agent Hello @dalagadenilesh, thank you for your contribution! To help us review this bug fix, could you please provide a more detailed 'Testing Plan'? Specifically, we need the instructions for manual End-to-End (E2E) tests and any relevant logs or screenshots that demonstrate the fix is working as expected. This information is crucial for our review process as outlined in the contribution guidelines. Thanks! |
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):
include_contentsparameters tononefor LlmAgent, the behavior is not aligned with the declaration in the manual. #35352. Or, if no issue exists, describe the change:
Problem:
The issue is that if a sub-agent is transferred to take over control, the context should include the user input. But the actual context for this sub-agent doesn't contain the latest user input, but the last transfer_to_agent context from the parent agent.
Solution:
Solution is to avoid adding events with either transfer_to_agent exits or name of the agent function call is 'transfer_to_agent'
Testing Plan
N/A
Unit Tests:
Please include a summary of passed
pytestresults.Manual End-to-End (E2E) Tests:
Please provide instructions on how to manually test your changes, including any
necessary setup or configuration. Please provide logs or screenshots to help
reviewers better understand the fix.
Checklist
Additional context
Add any other context or screenshots about the feature request here.