-
Notifications
You must be signed in to change notification settings - Fork 393
fix continue generation #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix continue generation #736
Conversation
Summary of ChangesHello @tastelikefeet, 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 enhances the robustness and flexibility of the system's code generation and LLM interaction capabilities. It streamlines the processing of continuous LLM responses, removes previous constraints on file output locations, and introduces a clear guideline for managing image assets during code generation. Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to fix an issue with continue generation. The changes involve modifying logic in openai_llm.py
, removing some validation in artifact_callback.py
, and updating a prompt in coding_callback.py
. My review has found a critical issue in the core logic change in openai_llm.py
that could lead to incorrect conversation history. Additionally, I've noted a medium-severity issue regarding the removal of file path validation, which could impact the correctness of the generated project structure.
for f in all_files: | ||
if not f['filename'].startswith( | ||
'frontend') and not f['filename'].startswith( | ||
'backend') and f['filename'] != 'files.json': | ||
results.append( | ||
f'Error: You should generate files in frontend or backend, ' | ||
f'but now is: {f["filename"]}') | ||
else: | ||
result = await self.file_system.write_file( | ||
f['filename'], f['code']) | ||
results.append(result) | ||
result = await self.file_system.write_file(f['filename'], | ||
f['code']) | ||
results.append(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the filename validation check, which previously restricted file writes to frontend
or backend
directories, introduces a potential risk. Without this safeguard, the agent could write files to any location within the output directory. This may disrupt the intended project structure and lead to correctness issues if files are not placed in their expected locations. It is advisable to retain some form of validation to enforce the desired project structure.
Change Summary
Related issue number
Checklist
pre-commit install
andpre-commit run --all-files
before git commit, and passed lint check.