Skip to content

Conversation

tastelikefeet
Copy link
Collaborator

Change Summary

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Run pre-commit install and pre-commit run --all-files before git commit, and passed lint check.
  • Documentation reflects the changes where applicable

Copy link

Summary of Changes

Hello @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

  • LLM Continue Generation Logic Refinement: The logic for handling partial messages during continuous LLM generation has been improved to prevent redundant message appends when content is identical and to remove an unnecessary message reformatting step.
  • File Generation Path Restrictions Removed: Restrictions on where generated files can be written have been lifted, allowing the system to save files to any specified path instead of being limited to 'frontend', 'backend', or 'files.json'.
  • New Image Generation Guideline: A new instruction has been added to the code generation process, explicitly stating that ico or png files should not be generated and images should always be imported from Unsplash.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 41 to +44
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)

Choose a reason for hiding this comment

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

medium

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.

@wangxingjun778 wangxingjun778 merged commit 11c2f2b into modelscope:main Sep 23, 2025
1 of 2 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.

2 participants