Skip to content

fix build webui#840

Merged
tastelikefeet merged 1 commit intomodelscope:mainfrom
tastelikefeet:fix/build_web_ui
Jan 31, 2026
Merged

fix build webui#840
tastelikefeet merged 1 commit intomodelscope:mainfrom
tastelikefeet:fix/build_web_ui

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

@gemini-code-assist
Copy link
Contributor

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 addresses critical issues related to the ms_agent web UI build and packaging. It integrates the web UI frontend build process directly into the Python package's setup.py, ensuring that the UI is properly compiled and included when the package is installed. Additionally, it refines file inclusion rules in MANIFEST.in and setup.py and corrects a path resolution error in the CLI, making the web UI more robust and functional. The changes also include minor UI logic improvements for better user interaction.

Highlights

  • Web UI Build Integration: The setup.py script now includes a comprehensive process to build the web UI frontend (using npm install and npm run build) and copy its assets into the Python package during installation, ensuring the UI is functional out-of-the-box.
  • Packaging Manifest Updates: MANIFEST.in and setup.py's package_data have been updated to correctly include all necessary web UI files (backend Python files and built frontend assets) and to exclude common development-related files like .pyc and __pycache__.
  • Path Correction for Web UI: A fix in ms_agent/cli/ui.py corrects the base path used to locate the webui directory, resolving an issue where the UI might not have been found due to an incorrect relative path.
  • Frontend UI Logic Refinements: The ConversationView.tsx component in the web UI now dynamically enables or disables the input field based on whether the system is loading or explicitly waiting for user input, improving user experience. It also simplifies file language handling by removing the fileLang state.

🧠 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 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
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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
Contributor

@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 the web UI build process. The changes include significant updates to setup.py to automate the frontend build and packaging, modifications to MANIFEST.in to control packaged files, and some refactoring in the frontend React components.

My review has identified a critical issue in MANIFEST.in that would likely cause the source distribution (sdist) to be broken and uninstallable. I've also pointed out a couple of medium-severity issues related to code style in setup.py and unused props in a React component that should be addressed for better maintainability. Overall, the changes to automate the web UI build are a great step forward, but the packaging configuration needs to be corrected.

Comment on lines +1 to +19
include README.md
include LICENSE
include requirements.txt
recursive-include requirements *.txt

# Include projects
recursive-include projects *

# Include webui backend
recursive-include webui/backend *.py

# Include webui frontend dist (will be built during setup)
recursive-include webui/frontend/dist *
recursive-include projects *

# Exclude development files
global-exclude *.pyc
global-exclude __pycache__
global-exclude .DS_Store
global-exclude *.so
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The current MANIFEST.in configuration will likely create a broken source distribution (sdist). It includes webui/frontend/dist, which is a build artifact, but omits the frontend source files (webui/frontend/src, webui/frontend/package.json, etc.).

When building from a source distribution, the setup.py script needs the frontend source files to run npm install and npm run build. Without them, the build will fail.

To fix this, you should include the frontend source files and exclude build artifacts and dependencies from the sdist.

include README.md
include LICENSE
include requirements.txt
recursive-include requirements *.txt

# Include projects
recursive-include projects *

# Include webui backend and frontend sources
recursive-include webui/backend *.py
recursive-include webui/frontend *

# Exclude development files and build artifacts from sdist
global-exclude *.pyc
global-exclude __pycache__
global-exclude .DS_Store
global-exclude *.so
global-exclude webui/frontend/node_modules *
global-exclude webui/frontend/dist *


def _build_and_copy_webui(self):
"""Build frontend and copy webui files to build directory"""
import subprocess
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

According to PEP 8, imports should be at the top of the file. Please move import subprocess to the top-level imports with os, shutil, etc. This improves readability and makes it easier to see the module's dependencies at a glance.


const MessageBubble: React.FC<MessageBubbleProps> = ({
message, isStreaming, sessionStatus, completedSteps,
message, isStreaming,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While you've removed sessionStatus and completedSteps from being destructured here, they are still part of the MessageBubbleProps interface and are being passed to this component from ConversationView. To fully clean this up and prevent passing unused props, please also remove them from the MessageBubbleProps interface and from the <MessageBubble ... /> invocation in ConversationView.

@tastelikefeet tastelikefeet merged commit 42a7d01 into modelscope:main Jan 31, 2026
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