Skip to content

feat(usage): add minimax and zhipu usage templates#1865

Open
WQfans wants to merge 2 commits into
farion1231:mainfrom
WQfans:feat/usage-query
Open

feat(usage): add minimax and zhipu usage templates#1865
WQfans wants to merge 2 commits into
farion1231:mainfrom
WQfans:feat/usage-query

Conversation

@WQfans
Copy link
Copy Markdown

@WQfans WQfans commented Apr 3, 2026

Summary / 概述

支持 MiniMax 和 Zhipu 用量模板。
本次改动包括:
新增 MiniMax 和 Zhipu 的用量模板配置与响应解析逻辑
支持从已支持的 provider 配置中自动识别对应模板
在用量脚本弹窗中补充 MiniMax 和 Zhipu 的预设与表单支持
为 MiniMax 和 Zhipu 的请求地址增加前端必填校验
同步更新相关国际化文案
模板能力按独立文件拆分,便于后续继续接入更多 provider 的用量模板

Related Issue / 关联 Issue

Fixes #1588

Screenshots / 截图

Before / 修改前 After / 修改后
usage-before usage

Checklist / 检查清单

  • [完成] pnpm typecheck passes / 通过 TypeScript 类型检查
  • [完成] pnpm format:check passes / 通过代码格式检查
  • [未修改] cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)
  • [完成] Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件

@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

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

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.

Reviewed commit: ebc4cfd307

ℹ️ 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 thread src/config/usageTemplates/minimax.ts Outdated
@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

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

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.

Reviewed commit: ebc4cfd307

ℹ️ 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 thread src/config/usageTemplates/minimax.ts Outdated
@WQfans
Copy link
Copy Markdown
Author

WQfans commented Apr 4, 2026

已修复。

补充了 OpenCode / OpenClaw 场景下的 provider base URL 检测,MiniMax / Zhipu 模板自动识别不再只依赖 websiteUrl,现在也会正确读取运行时配置里的 options.baseURL 或顶层 baseUrl。
同时我也补齐了后端 usage 查询对 opencode / openclaw 的凭证回退逻辑。即使 usage script 里没有单独填写 apiKey / baseUrl,仍然可以从 provider 配置中正确回退读取。我本地也验证了 OpenCode / OpenClaw 下不填写 usage script 的 apiKey 也能正常查询。

@WQfans
Copy link
Copy Markdown
Author

WQfans commented Apr 4, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

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.

[Feature] 添加智谱 GLM Coding Plan 用量查询脚本示例

2 participants