Skip to content

Conversation

jerryno6
Copy link

@jerryno6 jerryno6 commented Jul 19, 2025

…onshot.ai/v1/models

💻 变更类型 | Change Type

  • feat
  • fix
  • refactor
  • perf
  • style
  • test
  • docs
  • ci
  • chore
  • build

🔀 变更说明 | Description of Change

  • Update the wrong url of moonshot api api.moonshot.cn to api.moonshot.ai
  • Update the list of moonshotModels which was get from api.moonshot.ai/v1/models

📝 补充信息 | Additional Information

Summary by CodeRabbit

  • New Features

    • Expanded the list of available Moonshot models, including new variants and preview models.
  • Chores

    • Updated the Moonshot API base URL to a new address.

Copy link
Contributor

coderabbitai bot commented Jul 19, 2025

Walkthrough

The changes update the Moonshot API base URL and significantly expand the list of supported Moonshot model names. The default models array is also updated to reflect this expanded set of models. No other logic or structural changes are introduced.

Changes

File(s) Change Summary
app/constant.ts Updated Moonshot API base URL; replaced old model list with an expanded array; updated default models mapping.

Poem

A rabbit hopped to update the list,
With new Moonshot models—none to be missed!
The API’s address got a shiny new name,
More models to choose, the code’s not the same.
Hooray for the changes, so crisp and so neat,
Now Moonshot’s selection is truly complete!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/constant.ts

Oops! Something went wrong! :(

ESLint: 8.49.0

TypeError: Cannot read properties of undefined (reading 'loc')
Occurred while linting /app/constant.ts:1
Rule: "unused-imports/no-unused-imports"
at normalizeReportLoc (/node_modules/eslint-rule-composer/lib/rule-composer.js:47:26)
at normalizeReport (/node_modules/eslint-rule-composer/lib/rule-composer.js:107:12)
at Object.value [as report] (/node_modules/eslint-rule-composer/lib/rule-composer.js:143:72)
at Program:exit (/node_modules/eslint/lib/rules/no-unused-vars.js:694:33)
at ruleErrorHandler (/node_modules/eslint/lib/linter/linter.js:1051:28)
at /node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (/node_modules/eslint/lib/linter/node-event-generator.js:326:22)

✨ Finishing Touches
  • 📝 Generate Docstrings

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/constant.ts (1)

626-637: Hard-coding the model list invites drift – fetch or cache from /v1/models instead

Keeping this array in sync with Moonshot’s rapidly-evolving catalog will require repetitive PRs. Consider loading the model names at boot time (with a cached fallback) to stay current automatically:

-const moonshotModels = [
-  "moonshot-v1-auto",
-  // …
-  "kimi-latest",
-];
+// Prefer live data; fall back to a static list if the request fails.
+const moonshotModels = await fetchMoonshotModels(MOONSHOT_BASE_URL)
+  .catch(() => [
+    "moonshot-v1-auto",
+    // …
+    "kimi-latest",
+  ]);

A tiny helper that requests GET ${MOONSHOT_BASE_URL}/v1/models, filters id, and caches the result would eliminate manual updates and reduce merge noise.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d958441 and 6a8e417.

📒 Files selected for processing (1)
  • app/constant.ts (3 hunks)
🔇 Additional comments (2)
app/constant.ts (2)

28-28: Base URL fix looks good – check for env overrides

MOONSHOT_BASE_URL now points at https://api.moonshot.ai, matching the production endpoint. Verify that any environment-level override (e.g. MOONSHOT_BASE_URL in deployment configs) is still respected elsewhere so the value isn’t silently hard-coded at runtime.


824-834: No leftover moonshotModes references found after rename

A global search for moonshotModes returned no hits, confirming that all usages have been updated to moonshotModels. Everything looks good here.

@jerryno6 jerryno6 closed this Jul 21, 2025
@jerryno6 jerryno6 reopened this Jul 21, 2025
@Leizhenpeng Leizhenpeng merged commit a2a2664 into ChatGPTNextWeb:main Jul 23, 2025
1 of 3 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.

3 participants