-
Notifications
You must be signed in to change notification settings - Fork 446
Feat/webui code genesis #837
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @vinci-grape, 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 significantly expands the WebUI's capabilities by integrating the 'code_genesis' project, which facilitates advanced, agent-based code generation. It introduces new workflow definitions, including a master orchestrator and a simplified workflow, to manage complex code creation tasks. A key enhancement is the addition of an 'edit_file' tool, allowing agents to perform targeted code modifications within existing files using external large language models. The WebUI has been updated to provide a more intuitive user experience with dynamic workflow visualization, improved session handling, and a centralized settings dialog for LLM and tool configurations, including the new 'edit_file' tool. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 introduces significant enhancements to the WebUI, primarily focusing on integrating the code_genesis project with new workflow orchestration capabilities and an edit_file tool. Key changes include adding support for a 'simple workflow' variant, a new UI component for visualizing workflow steps, and improved error reporting for API calls. Configuration management has been refined, moving sensitive settings to a user-specific directory and providing more granular control over LLM and tool settings. The code_genesis agents' prompts have been updated for clarity and to incorporate new functionalities, such as the edit_file tool and EdgeOne Pages deployment. Overall, these changes greatly improve the functionality, user experience, and robustness of the WebUI for code generation tasks.
| # Convert temperature to float and max_tokens to int if they're numeric strings | ||
| value_to_set = extra[current_path] | ||
| if name == 'temperature' and isinstance( | ||
| value_to_set, str): | ||
| try: | ||
| value_to_set = float(value_to_set) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| elif name == 'max_tokens' and isinstance( | ||
| value_to_set, str): | ||
| try: | ||
| value_to_set = int(value_to_set) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| setattr(_config, name, value_to_set) |
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.
| # Convert temperature to float and max_tokens to int if they're numeric strings | ||
| value_to_set = extra[key_match] | ||
| if name == 'temperature' and isinstance( | ||
| value_to_set, str): | ||
| try: | ||
| value_to_set = float(value_to_set) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| elif name == 'max_tokens' and isinstance( | ||
| value_to_set, str): | ||
| try: | ||
| value_to_set = int(value_to_set) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| setattr(_config, name, value_to_set) |
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.
| edit_file_config: | ||
| diff_model: morph-v3-fast | ||
| api_key: | ||
| base_url: https://api.morphllm.com/v1 |
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 api_key and base_url for edit_file_config are currently empty. While the WebUI provides a mechanism to configure these, it's important to ensure that the default configuration here either points to a valid default or clearly indicates that these need to be set by the user for the edit_file tool to function.
| api_key: | ||
| base_url: https://api.morphllm.com/v1 |
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.
| else: | ||
| # If no API key, exclude edit_file from tools | ||
| # Read the current include list from config file and remove edit_file | ||
| try: | ||
| with open(config_file, 'r', encoding='utf-8') as f: | ||
| config_data = yaml.safe_load(f) | ||
| if config_data and 'tools' in config_data and 'file_system' in config_data[ | ||
| 'tools']: | ||
| include_list = config_data['tools']['file_system'].get( | ||
| 'include', []) | ||
| if isinstance(include_list, | ||
| list) and 'edit_file' in include_list: | ||
| # Remove edit_file from the list | ||
| filtered_include = [ | ||
| tool for tool in include_list | ||
| if tool != 'edit_file' | ||
| ] | ||
| # Pass the filtered list as comma-separated string | ||
| cmd.extend([ | ||
| '--tools.file_system.include', | ||
| ','.join(filtered_include) | ||
| ]) | ||
| except Exception as e: | ||
| print( | ||
| f'[Runner] Warning: Could not read config file to exclude edit_file: {e}' | ||
| ) | ||
| # Fallback: explicitly exclude edit_file | ||
| cmd.extend(['--tools.file_system.exclude', 'edit_file']) |
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 logic to dynamically exclude edit_file from the file_system.include list when no API key is provided is robust. However, if the config_file cannot be read (e.g., due to permissions or malformed YAML), it falls back to explicitly excluding edit_file. This fallback is good, but ensure the print statement for the warning is sufficiently visible for debugging potential configuration issues.
| 'api_key': '', | ||
| 'base_url': 'https://api.morphllm.com/v1', |
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.
| p: 1, | ||
| width: 110, |
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.
| overflow: 'hidden', | ||
| textOverflow: 'ellipsis', | ||
| whiteSpace: 'nowrap', |
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 whiteSpace: 'nowrap' property combined with textOverflow: 'ellipsis' is good for single-line truncation. However, if node.config contains multi-line text, this will prevent it from wrapping. Given the config field can be a path, it might be long. Consider if multi-line display with a max-height and overflow scroll might be more informative for longer config strings, or ensure node.config is always a single line.
| }} | ||
| min={0} | ||
| max={2} | ||
| max={1} |
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 max value for the temperature slider is set to 1. While this is a common range for temperature, some LLMs might support values slightly above 1 (e.g., up to 2). Ensure this constraint aligns with the capabilities of all supported LLM providers, or adjust the maximum value if higher temperatures are desired for certain models.
| # PY_VERSION=$($PYTHON_CMD -c "import sys; print(sys.version_info[:2] >= (3, 10))") | ||
| # if [ "$PY_VERSION" != "True" ]; then | ||
| # echo -e "${RED}Error: Python 3.10+ required.${NC}" | ||
| # exit 1 | ||
| # fi |
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 Python 3.10+ version check has been commented out. While this might relax the requirement, it could potentially lead to compatibility issues if ms-agent or its dependencies rely on features or syntax introduced in Python 3.10 or later. It's important to verify that the project functions correctly with older Python versions if this check is permanently removed.
Change Summary
Added code_genesis project support for WebUI, including workflow configuration updates, frontend and backend integration, and the addition of orchestrator and simple_workflow.
Related issue number
Checklist
pre-commit installandpre-commit run --all-filesbefore git commit, and passed lint check.