Make Code Review DAP flow review step agentic with on-demand repository context access
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Update the Code Review DAP flow to make the main perform_code_review step an AgentComponent with the ability to access repository context on-demand during the review process.
Problem Statement
The current review step (step 7) is a OneOffComponent with only post_duo_code_review tool access. It cannot read additional files or search code during the review itself. Review quality is capped by whatever context the preceding steps managed to provide.
Current Limitations
-
Review step cannot fetch additional context: The reviewer cannot read additional files or search code when investigating specific leads during the review.
-
Prescan may miss relevant context: There is a possibility that prescan steps miss some context due to the fixed tool call budget, which can be exhausted before analyzing all changed files or their relationships.
Proposed Changes
-
Make the review step an
AgentComponentinstead ofOneOffComponent, giving it access to:get_repository_file/read_filefor on-demand context fetching- Code search capabilities to find callers/dependents of changed code
-
Enable reverse dependency analysis: Allow the reviewer to search for code that uses the changed files, not just code that changed files import
-
Dynamic context gathering: Let the reviewer fetch additional context when investigating specific leads rather than relying solely on upfront context collection
Expected Benefits
- Improved bug detection for issues requiring cross-file analysis
- Better discovery of runtime bugs related to callers/dependents of changed code
- More thorough reviews without significantly increasing upfront processing time
- Flexibility to investigate leads that emerge during the review process