Skip to content

Conversation

@yueny2020
Copy link
Contributor

Problem

  • code review tool doesn't consider the user prompt when generating findings

Solution

  • add user requirement to zipfile for code review tool and pass it to code review tool for finding generation.

Test

image

Language server local log:

[Info  - 4:31:39 PM] [2025-10-17T23:31:39.286Z] lserver: Agentic scan name: Standard-c8680f7a-993c-489a-91a1-92104a30d82e selectedModel: claude-sonnet-4 userRequirement: Review the active file for code quality issues only. Focus on code quality violations, maintainability issues, and best practices rather than security vulnerabilities.

Info  - 4:32:01 PM] [2025-10-17T23:32:01.346Z] lserver: Uploading file to amazonq-code-scan-us-east-1-29121b44f7b.s3.amazonaws.com/334644344633/1d1b59c7-a152-4a9a-b1a0-c73e3b0811b5-a0d32856-8d8b-49cf-94b8-4ec9d1b08672/adbc1257-5873-4081-843a-d7dc956971b4/SourceCode

Downloaded the file and verified the content is correct.
image

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yueny2020 yueny2020 requested a review from a team as a code owner October 17, 2025 23:42
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.43%. Comparing base (bee5cad) to head (6b60476).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2430   +/-   ##
=======================================
  Coverage   62.42%   62.43%           
=======================================
  Files         266      266           
  Lines       59143    59156   +13     
  Branches     3796     3796           
=======================================
+ Hits        36920    36933   +13     
  Misses      22148    22148           
  Partials       75       75           
Flag Coverage Δ
unittests 62.43% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

'**3 main fields in the tool:**',
'**4 main fields in the tool:**',
'- scopeOfReview: CRITICAL - Must be set to either FULL_REVIEW (analyze entire file/folder/project/workspace) or CODE_DIFF_REVIEW (focus only on changes/modifications in the file/folder/project/workspace). This is a required field.',
'- userRequirement: CRITICAL - Must be set as a string to describe the user requirement by analyzing the current conversation and extracting all the related information for code review. This is a required field.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default behavior? If the user just says "review my code"? Might want to specify that in the prompt, or make it an optional field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always pass in this field even the user prompt doesn't have much info, but the LLM will check the current conversation to give the code review tool some requirement.

Copy link
Contributor

@laileni-aws laileni-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens for this prompt?

review my workspace

@yueny2020
Copy link
Contributor Author

What happens for this prompt?

review my workspace

LLM will generate a string to be as the input.

This is an example.
image

@yueny2020 yueny2020 merged commit 2c33b38 into aws:main Oct 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants