Skip to content

feat: revert model total credits#30518

Merged
CodingOnStar merged 1 commit intomainfrom
revert-26942-feat/model-total-credits
Jan 4, 2026
Merged

feat: revert model total credits#30518
CodingOnStar merged 1 commit intomainfrom
revert-26942-feat/model-total-credits

Conversation

@CodingOnStar
Copy link
Contributor

Reverts #26942

@CodingOnStar CodingOnStar marked this pull request as ready for review January 4, 2026 09:52
Copilot AI review requested due to automatic review settings January 4, 2026 09:52
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jan 4, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @CodingOnStar, 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 performs a comprehensive revert of a previously introduced feature concerning model total credits. The rollback primarily impacts the frontend, leading to the removal of various LLM provider icons, simplification of the quota display mechanism, and updates to user-facing text to reflect a more focused set of supported models for message credits. Additionally, some minor refactoring of icon rendering types and application context definitions is included.

Highlights

  • Feature Revert: This pull request reverts the 'feat: model total credits' feature, specifically rolling back changes introduced in langgenius/dify#26942.
  • Icon and Asset Removal: Numerous SVG icon files, along with their corresponding JSON data and TypeScript React components, have been removed. These include icons for various LLM providers such as Tongyi, Anthropic Short Light, Deepseek, Gemini, Grok, and several OpenAI variants.
  • Quota System Simplification: The logic for displaying model provider quotas has been simplified. The QuotaPanel component was refactored to remove multi-provider icon display and marketplace integration, now focusing on a single provider's quota. Related context and utility functions for quota management have also been streamlined.
  • UI Text Updates: Internationalization (i18n) files have been updated across English, Japanese, and Simplified Chinese to reflect the changes. Specifically, tooltips and descriptions related to message credits now refer primarily to OpenAI models, removing mentions of other LLMs like Gemini, xAI, DeepSeek, and Tongyi.
  • Context and Type Definition Refactoring: The AppContextValue and ICurrentWorkspace types have been updated to remove properties related to trial_credits, trial_credits_used, next_credit_reset_date, and isValidatingCurrentWorkspace, aligning with the reverted feature.

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

@CodingOnStar CodingOnStar changed the title Revert "feat: model total credits" feat: revert model total credits Jan 4, 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 reverts the "feat: model total credits" feature. The changes mostly involve removing code related to trial credits and a global quota panel, which seems correct given the goal of the PR. I've also noticed some unrelated fixes and refactoring. My review includes a couple of suggestions for improvement: one regarding an incorrect TypeScript type for a ref prop in several icon components, and another questioning a change in dimensions for an icon that might be unintentional. Overall, the revert appears to be on the right track.

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 reverts the "model total credits" feature (PR #26942), removing credit tracking functionality from the workspace context and UI components.

Key changes:

  • Removed workspace credit fields (trial_credits, trial_credits_used, next_credit_reset_date)
  • Reverted quota panel component from unified credits display back to per-provider quotas
  • Removed provider-specific icon files and enums for Gemini, xAI, DeepSeek, and Tongyi
  • Simplified i18n strings to reference only OpenAI instead of multiple providers

Reviewed changes

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

Show a summary per file
File Description
web/models/common.ts Removed credit-related fields from ICurrentWorkspace type
web/context/app-context.tsx Removed isValidatingCurrentWorkspace and credit initialization
web/i18n/**/common.json Reverted model provider strings and removed credit reset date string
web/i18n/**/billing.json Simplified message credit tooltip to reference only OpenAI
web/app/components/header/account-setting/model-provider-page/utils.ts Removed ModelProviderQuotaGetPaid enum and modelNameMap
web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx Reverted from unified credit display to per-provider quota panel
web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx Renamed showModelProvider to showQuota and restored QuotaPanel import
web/app/components/header/account-setting/model-provider-page/provider-added-card/credential-panel.tsx Removed IS_CLOUD_EDITION conditional checks
web/app/components/header/account-setting/model-provider-page/index.tsx Removed QuotaPanel component and mutateCurrentWorkspace effect
web/app/components/plugins/provider-card.tsx Added empty parentheses to onSuccess callback
web/app/components/billing/apps-full-in-dialog/index.spec.tsx Removed credit fields from test mock data
web/app/components/base/icons/src/public/llm/* Removed icon files for Gemini, xAI, DeepSeek, Tongyi, and OpenAI variants
web/app/components/base/icons/src/public/tracing/* Fixed ref type and JSON attribute ordering in icon files

💡 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:XXL This PR changes 1000+ lines, ignoring generated files.

3 participants