Closed hcavarsan closed 8 months ago
@CodiumAI-Agent /improve --extended
Suggestions | |||
---|---|---|---|
enhancement |
| ||
maintainability |
| ||
best practice |
| ||
performance |
|
Enabling\disabling automationWhen you first install the app, the [default mode](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) for the improve tool is: ``` pr_commands = ["/improve --pr_code_suggestions.summarize=true", ...] ``` meaning the `improve` tool will run automatically on every PR, with summarization enabled. Delete this line to disable the tool from running automatically. |
Utilizing extra instructionsExtra instructions are very important for the `improve` tool, since they enable to guide the model to suggestions that are more relevant to the specific needs of the project. Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify relevant aspects that you want the model to focus on. Examples for extra instructions: ``` [pr_code_suggestions] # /improve # extra_instructions=""" Emphasize the following aspects: - Does the code logic cover relevant edge cases? - Is the code logic clear and easy to understand? - Is the code logic efficient? ... """ ``` Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable. |
A note on code suggestions quality- While the current AI for code is getting better and better (GPT-4), it's not flawless. Not all the suggestions will be perfect, and a user should not accept all of them automatically. - Suggestions are not meant to be simplistic. Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base. - Recommended to use the 'extra_instructions' field to guide the model to suggestions that are more relevant to the specific needs of the project, or use the [custom suggestions :gem:](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) tool - With large PRs, best quality will be obtained by using 'improve --extended' mode. |
More PR-Agent commands> To invoke the PR-Agent, add a comment using one of the following commands: > - **/review**: Request a review of your Pull Request. > - **/describe**: Update the PR title and description based on the contents of the PR. > - **/improve [--extended]**: Suggest code improvements. Extended mode provides a higher quality feedback. > - **/ask \ |
💡 [best practice]
Consider using expect
instead of unwrap_or_else
for better error messages.
File: kftray-server/src/main.rs (28-31)
💡 [best practice]
Consider using match
instead of multiple if let
for handling different Result
variants.
File: kftray-server/src/main.rs (33-42)
💡 [best practice]
Consider using match
instead of multiple if let
for handling different Result
variants.
File: kftray-server/src/main.rs (44-53)
💡 [best practice]
Consider using if let
to handle the Result
of tcp_listener.accept().await
to avoid unnecessary nesting.
File: kftray-server/src/http_proxy.rs (148-148)
💡 [best practice]
Consider using if let
to handle the Result
of TcpStream::connect(&target)
to avoid unnecessary nesting.
File: kftray-server/src/tcp_proxy.rs (54-60)
💡 [best practice]
Consider using if let
to handle the Result
of udp_socket.recv(&mut buffer)
to avoid unnecessary nesting.
File: kftray-server/src/udp_over_tcp_proxy.rs (56-75)
@CodiumAI-Agent /describe
refactor(proxy): optimize buffer usage and enhance connection reliability