Skip to content

feat(ai): add MiniMax-M2.1 and upgrade GLM 4.7 as pro model - #133

Merged
2witstudios merged 2 commits into
masterfrom
claude/add-minimax-upgrade-glm-DoG2q
Dec 28, 2025
Merged

2witstudios merged 2 commits into
masterfrom
claude/add-minimax-upgrade-glm-DoG2q

Conversation

@2witstudios

@2witstudios 2witstudios commented Dec 28, 2025 •

Copy link
Copy Markdown
Owner
  • Add MiniMax-M2.1 model to MiniMax provider (10B active param MoE for coding agents)
  • Add GLM 4.7 to GLM provider, OpenRouter, and as new PageSpace pro tier model
  • Update pro model detection from glm-4.6 to glm-4.7 across web and iOS apps
  • Add pricing and 200K context window configuration for both new models
  • Keep glm-4.6 available as a standard option in GLM Coder Plan

Both models released Dec 22-23, 2025.

Summary by CodeRabbit

  • New Features

    • Added GLM-4.7 model support with 200,000 token context window
    • Added MiniMax-M2.1 model availability
    • Updated pricing configurations for new models
  • Bug Fixes

    • Improved model auto-correction logic for provider handling
    • Enhanced usage tracking and rate limiting for latest models
  • Chores

    • Updated subscription requirements and upgrade prompts for GLM-4.7
    • Refreshed provider model mappings across iOS and web platforms

✏️ Tip: You can customize this high-level summary in your review settings.

- Add MiniMax-M2.1 model to MiniMax provider (10B active param MoE for coding agents)
- Add GLM 4.7 to GLM provider, OpenRouter, and as new PageSpace pro tier model
- Update pro model detection from glm-4.6 to glm-4.7 across web and iOS apps
- Add pricing and 200K context window configuration for both new models
- Keep glm-4.6 available as a standard option in GLM Coder Plan

Both models released Dec 22-23, 2025.
@coderabbitai

coderabbitai Bot commented Dec 28, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 4779a7e and b8c2dae.

📒 Files selected for processing (1)
  • packages/lib/src/monitoring/ai-monitoring.ts

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

The pull request upgrades the PageSpace AI model references from glm-4.6 to glm-4.7 across iOS and web platforms, adds pricing and context window configurations for the new model, and introduces MiniMax-M2.1 entries to AI provider mappings and monitoring configurations.

Changes

Cohort / File(s) Summary
iOS Provider Constants & Configuration
apps/ios/PageSpace/Core/Constants/AIProviders.swift, apps/ios/PageSpace/Core/Managers/ConversationManager.swift, apps/ios/PageSpace/Core/Models/UsageData.swift, apps/ios/PageSpace/Core/State/UsageState.swift
Updated model version references from glm-4.6 to glm-4.7; added context window check for glm-4.7 returning 200,000 tokens; adjusted auto-correction and usage-state logic to target the newer model version.
iOS UI Components
apps/ios/PageSpace/Features/Chat/Components/ProviderModelPicker.swift, apps/ios/PageSpace/Features/Settings/SettingsView.swift
Updated upgrade notice gating conditions to reference glm-4.7 instead of glm-4.6 for subscription requirement checks.
Web API Routes
apps/web/src/app/api/ai/chat/route.ts, apps/web/src/app/api/ai/global/[id]/messages/route.ts
Replaced pro-model checks from glm-4.6 to glm-4.7 in rate-limit and usage-tracking logic for PageSpace provider paths.
Web Configuration & Pricing
apps/web/src/lib/ai/core/ai-providers-config.ts, packages/lib/src/monitoring/ai-monitoring.ts, packages/lib/src/monitoring/ai-context-calculator.ts
Added glm-4.7 and MiniMax-M2.1 model entries with corresponding pricing (glm-4.7: input 0.39/output 1.90) and context windows (glm-4.7: 200,000; MiniMax-M2.1: 128,000).
Web Components & Middleware
apps/web/src/components/layout/right-sidebar/ai-assistant/SidebarSettingsTab.tsx, apps/web/src/lib/subscription/rate-limit-middleware.ts
Updated access control and rate-limit checks to use glm-4.7 as the gated Pro/Business model; adjusted subscription requirement logic accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 From 4.6 to 4.7 we hop,
New tokens dance, context won't stop—
Two hundred thousand, a gleaming prize,
MiniMax joins beneath the skies,
Our prices set, our paths aligned,
Model upgrades, perfectly designed! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: adding MiniMax-M2.1 and upgrading GLM 4.7 as the pro model, matching the core objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 158 to 160
// GLM Direct Models (openrouter.ai, Dec 2025)
'glm-4.7': { input: 0.39, output: 1.90 },
'glm-4.6': { input: 0.39, output: 1.90 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add pricing entry for OpenRouter GLM-4.7

AI_PROVIDERS now exposes the OpenRouter model z-ai/glm-4.7, but AI_PRICING only adds the unprefixed glm-4.7. Because calculateCost looks up pricing by the exact model id, calls made through OpenRouter will miss this table and fall back to the default price (0 input/output), so monitoring will log zero cost for every GLM‑4.7 request even though it is a paid model. Please add a z-ai/glm-4.7 entry (and matching context window if needed) to keep cost tracking accurate.

Useful? React with 👍 / 👎.

Add missing z-ai/glm-4.7 entries to AI_PRICING and MODEL_CONTEXT_WINDOWS
to ensure accurate cost tracking for GLM 4.7 calls made via OpenRouter.
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.

2 participants