Skip to content

Conversation

@hjlarry
Copy link
Contributor

@hjlarry hjlarry commented Jan 2, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #30465

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings January 2, 2026 10:19
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 2, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hjlarry, 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 focuses on simplifying the model provider and model entity structures by eliminating the icon_large attribute. This change streamlines the data models and the associated logic for handling provider icons, indicating that the icon_large property is no longer a necessary component of the system's design or functionality.

Highlights

  • Removal of icon_large field: The icon_large field has been systematically removed from various Python Pydantic models and TypeScript interfaces across the codebase, including SimpleModelProviderEntity, DefaultModelProviderEntity, SimpleProviderEntity, ProviderEntity, ProviderResponse, ProviderWithModelsResponse, and related types.
  • Updated Icon Retrieval Logic: The get_provider_icon method in api/core/model_runtime/model_providers/model_provider_factory.py has been updated to no longer recognize or support icon_large as a valid icon type. Requests for icon_large will now result in a ValueError.
  • Cleanup in Service and Test Files: All references and mock data related to icon_large have been removed from service logic in api/services/model_provider_service.py and numerous test files, ensuring consistency with the removal of the field from core entities.

🧠 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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 2, 2026
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 systematically removes the icon_large property from various model and provider entities across the codebase. The changes are comprehensive, spanning backend entities, services, and factories, as well as frontend type definitions and tests. The logic that previously handled icon_large has been correctly updated to reflect its removal. The modifications are clean, consistent, and successfully achieve the goal of this refactoring task. Overall, this is a well-executed cleanup.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the deprecated icon_large field from model provider entities across the codebase, as it is no longer used by the frontend. The change is a clean refactoring that simplifies the data model.

Key Changes

  • Removed icon_large field from all backend Python entity classes and service responses
  • Removed icon_large field from frontend TypeScript type declarations
  • Updated documentation and error handling to reflect that only icon_small and icon_small_dark icon types are supported

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
api/core/entities/model_entities.py Removed icon_large field from SimpleModelProviderEntity and DefaultModelProviderEntity classes
api/core/model_runtime/entities/provider_entities.py Removed icon_large field from SimpleProviderEntity and ProviderEntity classes, and from to_simple_provider() method
api/core/model_runtime/model_providers/model_provider_factory.py Updated docstring and error handling to support only icon_small and icon_small_dark, rejecting icon_large requests
api/core/provider_manager.py Removed icon_large field from default model creation
api/services/entities/model_provider_entities.py Removed icon_large field from ProviderResponse, ProviderWithModelsResponse, and related URL prefix logic
api/services/model_provider_service.py Removed icon_large field from service methods and updated docstring to reflect supported icon types
api/tests/integration_tests/model_runtime/__mock/plugin_model.py Removed icon_large field from mock plugin model provider data
api/tests/test_containers_integration_tests/services/test_model_provider_service.py Removed icon_large field from test mock data across multiple test cases
api/tests/unit_tests/core/test_provider_configuration.py Removed icon_large field from mock provider entity in test
api/tests/unit_tests/services/test_model_provider_service_sanitization.py Removed icon_large field from test provider configuration
web/app/components/header/account-setting/model-provider-page/declarations.ts Removed icon_large field from ModelProvider, Model, and DefaultModelResponse TypeScript type declarations
web/app/components/plugins/plugin-detail-panel/model-selector/index.spec.tsx Removed icon_large field from test mock createModel() helper function
web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx Removed icon_large field from test mock data across multiple test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] remove icon_large of models

3 participants