Skip to content

Conversation

Jintao-Huang
Copy link
Collaborator

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.

Summary of Changes

Hello @Jintao-Huang, 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 improves the integration and flexibility of Qwen3-Coder models within the system. It introduces a new qwen3_coder agent template and model type, along with a refactoring of the _format_tools method across multiple agent templates to support optional system prompts. These changes streamline the configuration of agent-based models and ensure that Qwen3-Coder models are correctly represented and tested.

Highlights

  • New Qwen3-Coder Agent Template: A dedicated qwen3_coder model type and agent template have been introduced, specifically designed for Qwen3-Coder models, enhancing their integration and functionality within the system.
  • Flexible System Prompt Handling: The _format_tools method across various agent templates (including ReactGRPO, GLM4, Hermes, Llama, Mistral, Qwen, React, and ToolBench) has been updated to accept an optional system prompt, providing greater flexibility in agent configuration.
  • Qwen3-Coder Template Enhancements: The Qwen3CoderAgentTemplate now inherits from HermesAgentTemplate, and its _format_tools method includes a default system prompt and improved tool formatting, streamlining its behavior.
  • Documentation Updates: Both the Chinese and English documentation for supported models and datasets have been updated to correctly list Qwen3-Coder models under the new qwen3_coder template type.
  • Test Case Refinement: The test_qwen3_coder test case has been updated to remove explicit model_type specification, allowing for automatic inference, and includes a new assertion for template encoding consistency.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 introduces support for the qwen3_coder agent template, involving the addition of new model and template types, refactoring model registrations, and creating the Qwen3CoderAgentTemplate. A significant part of the change is updating the _format_tools method signature across various agent templates to correctly handle optional system prompts, which improves flexibility. Most changes are well-implemented and enhance code organization and correctness. I've identified one area for improvement in glm4.py where the system prompt handling could be more consistent with the other templates.

return functions

def _format_tools(self, tools: List[Union[str, dict]], system: str, user_message=None) -> str:
def _format_tools(self, tools: List[Union[str, dict]], system: Optional[str] = None, user_message=None) -> str:
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 the method signature is correctly updated to accept an Optional[str] for the system prompt, the implementation of this method currently ignores this parameter. Instead, it uses a hardcoded glm4_system string. This will cause any custom system prompt provided by the user to be discarded when tools are used. To ensure user-provided system prompts are respected, the implementation should be updated to utilize the system parameter, and only fall back to the default glm4_system when the system parameter is None.

@Jintao-Huang Jintao-Huang merged commit f278881 into modelscope:main Sep 14, 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.

1 participant