Skip to content

Revert 1385 patch 1 - #1472

Merged
creamlike1024 merged 1 commit into
alphafrom
revert-1385-patch-1
Jul 30, 2025
Merged

creamlike1024 merged 1 commit into
alphafrom
revert-1385-patch-1

Conversation

@creamlike1024

@creamlike1024 creamlike1024 commented Jul 30, 2025 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive dashboard with panels for statistics, charts, API info, announcements, FAQs, and uptime, featuring responsive layouts and advanced UI components.
    • Added advanced card, table, scrollable container, and compact mode toggle UI components.
    • Added support for new video generation channels and enhanced channel settings, including passthrough request body and system prompt options.
  • Improvements

    • Enhanced error handling and reporting across API responses.
    • Improved translation and UI labels for better clarity and internationalization.
    • Streamlined route management and removed unused edit routes in the console.
    • Refined request body handling for various API endpoints to support passthrough and parameter overrides.
    • Improved logo loading experience in the header and updated sidebar menu labels.
  • Bug Fixes

    • Corrected Unicode character length validation for redemption names.
    • Fixed quota consumption calculation to ensure a minimum value.
  • Documentation

    • Added or updated license headers and copyright notices throughout the codebase.
    • Updated README files with trusted partners and licensing changes.
    • Introduced and updated ESLint and code style configurations.
  • Chores

    • Updated ignore files to exclude ESLint cache.
    • Added ESLint scripts and dependencies for code quality enforcement.

@coderabbitai

coderabbitai Bot commented Jul 30, 2025 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new "vidu" video channel with a complete task adaptor, constants, and integration into the relay and controller layers. It also refactors and consolidates video relay modes, enhances request body passthrough and parameter override logic, and modularizes error handling and streaming for Gemini and Ollama channels. Numerous UI and dashboard components are added or updated, and a dual AGPLv3/commercial license replaces the previous Apache license. Many files also receive AGPLv3 license headers.

Changes

Cohort / File(s) Change Summary
Vidu Channel Integration
constant/channel.go, relay/channel/task/vidu/adaptor.go, relay/relay_adaptor.go
Adds new vidu channel constant, implements a full task adaptor for video generation, and integrates it into the relay adaptor selector.
Video Relay Refactor & Routing
relay/constant/relay_mode.go, controller/relay.go, controller/task.go, controller/swag_video.go, router/video-router.go, relay/relay_task.go
Consolidates video relay modes, updates controller and router logic for new GET endpoints, and removes Kling/Jimeng-specific relay mode mappings.
Kling Channel/Adaptor Improvements
relay/channel/task/kling/adaptor.go, middleware/kling_adapter.go, controller/redemption.go
Refactors Kling adaptor for unified API key handling, model field duplication, and Unicode-safe name validation.
Request Body Passthrough & Overrides
relay/claude_handler.go, relay/gemini_handler.go, relay/image_handler.go, relay/rerank_handler.go, relay/relay-text.go
Adds logic to use raw request bodies or apply parameter overrides based on global/channel settings across multiple relay helpers.
Channel Selection & Error Handling
model/ability.go, model/channel_cache.go, controller/channel-test.go, middleware/distributor.go, types/error.go, service/error.go
Refines channel selection to return (nil, nil) on absence, modularizes error types, and updates error construction and propagation.
Gemini & Ollama Channel Streaming/Conversion
relay/channel/gemini/adaptor.go, relay/channel/gemini/relay-gemini.go, relay/channel/gemini/relay-gemini-native.go, relay/channel/ollama/adaptor.go, relay/channel/ollama/relay-ollama.go, relay/channel/ollama/dto.go, relay/channel/openai/helper.go, relay/channel/openai/relay-openai.go, service/convert.go
Implements and refines Claude request conversion, streaming response helpers, and error handling for Gemini and Ollama channels.
SiliconFlow Channel Refactor
relay/channel/siliconflow/adaptor.go
Delegates Claude/image/audio request conversion to OpenAI adaptor, and refactors relay mode handling.
Task Platform and Constants Cleanup
constant/task.go
Removes Kling/Jimeng task platform constants.
Controller & Middleware Adjustments
common/page_info.go, middleware/auth.go
Changes query param for pagination, adds user group context key.
DTO and Struct Enhancements
dto/channel_settings.go, dto/openai_request.go
Adds passthrough and system prompt fields to channel settings, changes JSON schema handling to raw messages, and adds system role name logic.
Helper & Utility Updates
relay/helper/common.go, relay/helper/stream_scanner.go
Adds empty response generator and explicit "[DONE]" handling in stream scanner.
Rate Limiting & Pricing
setting/rate_limit.go, setting/operation_setting/tools.go
Adds max int validation for rate limits, simplifies web search pricing logic.
Frontend: Dashboard & UI Components
web/src/components/dashboard/*, web/src/components/common/ui/CardPro.js, web/src/components/common/ui/CardTable.js, web/src/components/common/ui/CompactModeToggle.js, web/src/components/common/ui/Loading.js, web/src/components/common/ui/ScrollableContainer.js, web/src/components/layout/*, web/src/components/settings/*, web/src/components/playground/*, web/src/App.js, web/package.json, web/.eslintrc.cjs, web/postcss.config.js
Adds new dashboard panels (charts, stats, FAQ, announcements, API info, uptime), new card/table/scrollable components, updates layout logic, adds ESLint config and scripts, and applies AGPLv3 headers.
Documentation & Licensing
LICENSE, README.md, README.en.md, .gitignore, .dockerignore, i18n/zh-cn.json
Replaces Apache license with dual AGPLv3/commercial license, adds partner sections to READMEs, updates ignore files, and adds translation keys for new channel settings.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WebUI
    participant API Server
    participant ViduAdaptor
    participant ViduAPI

    User->>WebUI: Submit video generation request
    WebUI->>API Server: POST /video/generations (with model, prompt, etc.)
    API Server->>ViduAdaptor: Build request payload
    ViduAdaptor->>ViduAPI: POST /api/video/generations
    ViduAPI-->>ViduAdaptor: JSON response (task id, state)
    ViduAdaptor-->>API Server: Task id, data
    API Server-->>WebUI: Task submission result

    User->>WebUI: Query task status
    WebUI->>API Server: GET /video/generations/:task_id
    API Server->>ViduAdaptor: Build status request
    ViduAdaptor->>ViduAPI: GET /api/video/generations/:task_id
    ViduAPI-->>ViduAdaptor: JSON response (status, result)
    ViduAdaptor-->>API Server: Task status/result
    API Server-->>WebUI: Status/result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • QuantumNous/new-api#1425: Adds a new video channel "vidu" with task adaptor and integration, directly related to the new vidu channel and adaptor introduced here.
  • QuantumNous/new-api#1244: Adds a video channel "kling" with similar task adaptor and relay changes, related by feature area (video channels).
  • QuantumNous/new-api#1443: Refactors channel selection and error handling, and implements Claude request conversion in Gemini adaptor, overlapping with several refactors in this PR.

Poem

In the garden of code where new channels bloom,
Vidu joins the dance, dispelling the gloom.
With streaming and errors now neatly in line,
Dashboards and panels in AGPL shine.
Rabbits hop forward, their reviews in tow—
Open source blossoms, as partners bestow!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-1385-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@creamlike1024
creamlike1024 changed the base branch from main to alpha July 30, 2025 04:18
@creamlike1024
creamlike1024 merged commit 6e806e2 into alpha Jul 30, 2025
@creamlike1024
creamlike1024 deleted the revert-1385-patch-1 branch August 30, 2025 15:38
@coderabbitai coderabbitai Bot mentioned this pull request Sep 16, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Mar 22, 2026
x22x22 pushed a commit to x22x22/new-api that referenced this pull request Apr 24, 2026
salem-2007 added a commit to salem-2007/new-api that referenced this pull request Sep 10, 2026
junjundesk pushed a commit to junjundesk/new-api that referenced this pull request Oct 3, 2026
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