Skip to content

feat(plugins): add provider plugins, request plugins and a community marketplace - #8271

Merged
Calcium-Ion merged 13 commits into
mainfrom
feat/provider-plugins
Nov 12, 2026
Merged

Calcium-Ion merged 13 commits into
mainfrom
feat/provider-plugins

Conversation

@Calcium-Ion

@Calcium-Ion Calcium-Ion commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

🔗 关联任务 / Related Issue

  • 无单独 Issue,按维护者的插件架构计划实施。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

📝 变更描述 / Description

插件分为任务、提供商、请求处理三类,共用插件中心。

  • 提供商插件:把一个上游厂商接成一种渠道,包括路由、协议转换、模型、静态密钥、需要登录的上游(登录与令牌刷新)、余额查询、渠道配置和定时维护钩子。
  • 请求处理插件:在请求和回复上运行(读入、请求、发送前、最终检查、回复检查、report)。实例按全局、分组、渠道和模型范围生效,可以试运行,每处修改记入使用日志。内置请求过滤、请求脱敏、全局参数覆盖、自动推理强度、图片压缩和内容审核。
  • 敏感词:首次启动时原敏感词设置迁成一个请求过滤实例,旧设置项删除。命中时返回 request_rejected,不再列出命中的词。
  • 多节点同步:不新建表,复用 system_tasks。每次保存数据新增一条同步任务(sync_<类别>),各节点每 3 秒检查一次,有新任务就重新加载。所有在线节点都加载完后,主节点把任务标为完成。设置、权限、插件、登录方式、模型、订阅套餐和渠道的手动改动,几秒内在各节点生效;渠道自动禁用仍按 SYNC_FREQUENCY 同步,和原来一样(带定时维护钩子的插件渠道除外)。系统信息页的任务列表显示同步进度和加载失败的节点,节点列表显示每个节点的同步状态。
  • 系统任务记录自动清理:每天删除超过保留天数的已结束系统任务,默认 30 天,在 系统设置 → 运维 → 日志维护 里修改。进行中的任务和每类最新一条不删。system_tasks 新增 (type, id) 索引,查各类最新一条不再扫全表。
  • 插件市场:
    • 官方来源旁新增社区来源(列表由 newapi.ai 提供)。
    • 官方和社区插件都可以按 8 位插件码查找。
    • 社区插件的标识必须带作者前缀。
    • 安装后上报安装次数。
    • 已安装的版本被下架时,在列表里提示。
    • 新的默认来源只对没保存过来源列表的网关生效。
    • 安装对话框显示插件的使用说明(README.md)和更新记录(CHANGELOG.md);发布到市场的每个版本都要附带这两个文件。
    • 插件下载站点由管理员手动选择:主站(www.newapi.ai)或备用站(www.newapi.pro)。
  • 图片计费:张数按发给上游的最终请求体计算,包括 SiliconFlow 的 batch_size、Imagen 的 parameters.sampleCount(不写时按 Imagen 默认的 4 张)和 Replicate 的 input.num_outputs。插件或渠道覆盖改了张数,预扣也跟着变。
  • 插件改写后的请求体超过 MAX_REQUEST_BODY_MB 时返回 413。
  • Plugin API v1 文档、JSON Schema 和类型定义同步更新。

⚠️ 升级说明 / Upgrade notes

  • 敏感词命中的返回:原来返回 500 sensitive_words_detected,现在返回 400 request_rejected。
  • 回滚:升级会删除旧的敏感词设置项。回滚到旧版本后敏感词检查是关闭的,需要重新填写。
  • 过滤范围:迁移出的实例检查的文字和旧检查相同,另外还检查 PDF、DOCX 附件里的文字,旧检查不看附件。
  • 插件总开关:只管插件任务和插件渠道。请求处理实例不受它影响,关掉总开关也照常运行。
  • 更新全部余额:改为系统任务,由主节点执行,最多同时查询 4 个渠道。页面不再等全部查完,列表随进度刷新到结束。CHANNEL_UPDATE_FREQUENCY 的定时更新也走这个任务,只在主节点运行(原来每个设置了该变量的节点各跑一次),手动和定时不会同时跑。
  • 系统任务记录:升级后,超过 30 天的已结束系统任务会被自动删除。需要保留更久的,先改保留天数。
  • 索引:升级时给 system_tasks 建一个 (type, id) 索引。原来只按 type 的索引保留不删。
  • 内容审核插件:审核服务出错或超时时一律拒绝请求,没有放行选项。文字超过一次请求的上限时分几次审核,超过约 4 MiB 时直接拒绝(moderation.too_long)。
  • 图片压缩插件:无损模式只转换 PNG 和 GIF,JPEG 和 WebP 保持原样。

📸 运行证明 / Proof of Work

以下针对当前提交 908037d(基于 origin/main bd6bb53):

  • CI: 后端(vet、build、test)、前端(typecheck、test)和 CodeRabbit 通过。
  • 构建: go build ./... 通过;改动包 go vet 无输出,gofmt -l 无文件。
  • Go 测试: model、service、setting/operation_setting、controller、router 运行 go test -count=1 全部通过。
  • 数据库(同步与清理): SQLite 3.50.4、MySQL 5.7.44、PostgreSQL 9.6.24、PostgreSQL 17.11:
    • 新建库第二次启动不执行 DDL;从 v1.0.0-rc.49 升级,第一次启动只执行 CREATE INDEX idx_system_tasks_type_id,第二次启动不执行 DDL,原有数据保留;
    • model 三库矩阵测试,以及 service 的节点同步、OAuth 提供方和定时维护测试(每库 30 项)通过;
    • 20 万行时,MySQL 5.7 查各类最新一条从 0.513 秒降到 0.0005 秒;PostgreSQL 改为索引扫描。
  • 两节点实测(PostgreSQL 17): 设置、登录方式、插件、渠道、权限的改动在 1 到 3 秒内同步到另一节点,同步任务结束为 2/2;暂停一个节点时任务停在 1/2,恢复后完成。
  • 更新全部余额: 测试覆盖排队、重复请求返回同一任务、进度 1/1、结束后可再排、任务中断后标为失败、进度接口只读余额任务;前端测试覆盖进度刷新、跟随已在运行的任务、重复点击不重复跟随。
  • 评审问题: 每个问题先写复现测试,修复前失败、修复后通过。覆盖畸形 PDF 与 WebP、application/jsonl 请求体、json.patch 复制膨胀、Gemini 多段回复、auto 分组、请求过滤与旧检查范围一致(32 例)、请求脱敏和内容审核的大请求、图片张数字段、渠道其他信息的并发写入。PDF 解析另做了 2 × 30 秒模糊测试,约 18.9 万个输入,无失败。
  • 与最新 main 合并: origin/main(a9932d1f9)与 908037d 合并无冲突。
  • web: bun check -b 无错误;改动文件的 oxlint 和 oxfmt --check 通过;system-info、system-settings、channels 共 380 个测试通过;7 种语言各 7721 个键,无缺失。

之前的验证(更早的提交):

  • 数据库:
    • e4a4d22 上:凭据刷新锁、OAuth 提供方写入和刷新期间的渠道并发写入,在 MySQL 5.7.44、PostgreSQL 17.11、PostgreSQL 9.6.24 上通过。
    • 定时维护钩子在 SQLite 3.50.4、MySQL 5.7.44、PostgreSQL 9.6.24 上各通过 17 项测试。
  • relaykit: cd relaykit && GOWORK=off go build ./... && GOWORK=off go test ./dto/... ./types/... 通过。这一轮没有改 relaykit。
  • 端到端:
    • 网关与本地 newapi.ai 站点联调社区市场:提交、上架、按插件码安装、计数、下架提示都通过。
    • 用插件重写 AWS Bedrock 和 Vertex,与内置渠道逐项对比,99/99 一致。这两个测试插件不进仓库。
  • 上游登录的实施依据: OWASP ASVS 5.0 V10、OWASP OAuth 2.0 Cheat Sheet、RFC 9700、RFC 7636(PKCE)、RFC 8628(设备授权)、RFC 9207。

✅ 提交前检查项 / Checklist

  • 人工确认: 无论描述是否由 AI 生成,我已审阅并精炼全文,仅保留可复核的要点,并声明对其准确性与完整性负责。PR 正文及后续评论均未直接粘贴未经人工过滤的大段 AI 文本。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • 新功能关联 Issue: 若此 PR 标记为 New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。
  • 事前沟通: 若改动较大或涉及方向性变更,已在关联 Issue 中与维护者沟通并达成一致。
  • 功能范围: 本 PR 不是 Coding Plan、逆向渠道、第三方封装接口,也不是对 Codex 渠道类型的改动。
  • 非透传: 本 PR 不是针对开启透传后的转发行为;透传会直接发送内容,不会经过 new-api 的逻辑处理。
  • 范围聚焦: 本 PR 为一项聚焦改动,未包含无关代码。
  • 本地验证: 已按变更路径实际验证,并写明命令与观察结果。仅声明 go build 通过或测试通过,不视为有效证明。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

🤖 Generated with Claude Code

…marketplace

- Provider plugins turn an upstream vendor into a channel type: routes,
  protocol conversion, models, static keys, sign-in flows with token
  refresh, balance queries, per-channel config and a scheduled hook.
- Request plugins run on requests and replies (ingress, request,
  outbound, egress, reply, report), with instances by scope, model
  ranges, dry runs and per-log records. Built-ins: request filter,
  request redaction, parameter override, auto reasoning effort, image
  compression and content moderation. Sensitive words move into a
  request filter instance on first start.
- Node sync: a system_sync_topics table lets every node reload settings,
  channels, plugins and other data within seconds, and the system info
  page shows each node's state.
- Marketplace: a community source next to the official one, lookup by
  plugin code for official and community plugins, key rules for
  community plugins, install counts and takedown warnings.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 388 files, which is 88 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: efd44cc7-a685-4959-a0c0-5816abdf770f
Commits

Reviewing files that changed from the base of the PR and between f3d8b73 and 72180db.

Files ignored due to path filters: 7

  • go.sum is excluded by !**/*.sum
  • plugins/tasks/auto-reasoning/icon.svg is excluded by !**/*.svg
  • plugins/tasks/content-moderation/icon.svg is excluded by !**/*.svg
  • plugins/tasks/image-compress/icon.svg is excluded by !**/*.svg
  • plugins/tasks/param-override/icon.svg is excluded by !**/*.svg
  • plugins/tasks/request-filter/icon.svg is excluded by !**/*.svg
  • plugins/tasks/request-redact/icon.svg is excluded by !**/*.svg
Files selected for processing: 388

  • .env.example
  • THIRD-PARTY-LICENSES.md
  • common/api_type.go
  • common/gin.go
  • common/init.go
  • common/log_text.zh-CN.json
  • constant/api_type.go
  • constant/context_key.go
  • constant/env.go
  • controller/channel-billing.go
  • controller/channel-test.go
  • controller/channel.go
  • controller/channel_authz.go
  • controller/channel_balance.go
  • controller/channel_plugin_gaps_test.go
  • controller/channel_task_plugin_validation_test.go
  • controller/channel_upstream_update.go
  • controller/codex_usage.go
  • controller/model_meta.go
  • controller/option.go
  • controller/plugin_native_e2e_test.go
  • controller/plugin_protocol.go
  • controller/plugin_protocol_image.go
  • controller/provider_plugin.go
  • controller/provider_plugin_test.go
  • controller/relay.go
  • controller/request_plugin.go
  • controller/responses_websocket_plugin_test.go
  • controller/system_info.go
  • controller/system_task_handlers.go
  • controller/task.go
  • controller/task_plugin.go
  • controller/task_plugin_test.go
  • controller/user.go
  • docs/plugin-api/v1.d.ts
  • docs/plugin-api/v1.md
  • docs/plugin-api/v1.schema.json
  • go.mod
  • i18n/keys.go
  • i18n/locales/en.yaml
  • i18n/locales/zh-CN.yaml
  • i18n/locales/zh-TW.yaml
  • main.go
  • middleware/access_token_routes.go
  • middleware/distributor.go
  • middleware/task_plugin.go
  • model/ability.go
  • model/auth_flow.go
  • model/channel.go
  • model/channel_balance.go
  • model/channel_cache.go
  • model/channel_constraint.go
  • model/channel_constraint_test.go
  • model/channel_plugin_credential.go
  • model/channel_plugin_credential_test.go
  • model/channel_priority.go
  • model/channel_status_test.go
  • model/custom_oauth_provider.go
  • model/log.go
  • model/model_meta.go
  • model/model_metadata_sync.go
  • model/model_pricing_config.go
  • model/model_pricing_conversion.go
  • model/option.go
  • model/option_auto_group_test.go
  • model/option_task_plugin_test.go
  • model/passkey_option.go
  • model/pricing.go
  • model/pricing_usage_schema_test.go
  • model/request_policy.go
  • model/request_policy_test.go
  • model/sensitive_word_migration.go
  • model/sensitive_word_migration_test.go
  • model/subscription.go
  • model/system_sync_task.go
  • model/system_task.go
  • model/system_task_test.go
  • model/task.go
  • model/task_plugin.go
  • oauth/registry.go
  • pkg/billingexpr/compile.go
  • pkg/billingexpr/expr.md
  • pkg/jsplugin/channel_config_test.go
  • pkg/jsplugin/config_schema.go
  • pkg/jsplugin/engine.go
  • pkg/jsplugin/engine_test.go
  • pkg/jsplugin/fetch.go
  • pkg/jsplugin/keywords.go
  • pkg/jsplugin/keywords_test.go
  • pkg/jsplugin/media.go
  • pkg/jsplugin/provider.go
  • pkg/jsplugin/provider_test.go
  • pkg/jsplugin/registry.go
  • pkg/jsplugin/registry_master_enabled_test.go
  • pkg/jsplugin/registry_test.go
  • pkg/jsplugin/request.go
  • pkg/jsplugin/routing.go
  • pkg/jsplugin/routing_test.go
  • pkg/jsplugin/sample.go
  • pkg/jsplugin/transform.go
  • pkg/jsplugin/utils.go
  • pkg/requestpatch/patch.go
  • pkg/requestpatch/patch_test.go
  • plugins/builtin_plugins_test.go
  • plugins/request_plugins_test.go
  • plugins/tasks/auto-reasoning/plugin.js
  • plugins/tasks/content-moderation/plugin.js
  • plugins/tasks/image-compress/plugin.js
  • plugins/tasks/param-override/plugin.js
  • plugins/tasks/request-filter/plugin.js
  • plugins/tasks/request-redact/plugin.js
  • plugins/tasks/vertex-ai/plugin.js
  • plugins/vertex_ai_region_test.go
  • relay/alpha_search_handler.go
  • relay/channel/advancedcustom/adaptor.go
  • relay/channel/api_request.go
  • relay/channel/gemini/adaptor.go
  • relay/channel/openai/relay_realtime.go
  • relay/channel/providerplugin/adaptor.go
  • relay/channel/providerplugin/chain.go
  • relay/channel/providerplugin/eventstream.go
  • relay/channel/providerplugin/eventstream_test.go
  • relay/channel/providerplugin/management.go
  • relay/channel/providerplugin/management_test.go
  • relay/channel/providerplugin/stream.go
  • relay/channel/replicate/adaptor.go
  • relay/channel/siliconflow/adaptor.go
  • relay/channel/task/jsplugin/adaptor.go
  • relay/channel/task/jsplugin/channel_context_test.go
  • relay/channel/task/jsplugin/credential.go
  • relay/channel/task/jsplugin/credential_test.go
  • relay/channel/vertex/adaptor.go
  • relay/chat_completions_via_responses.go
  • relay/claude_handler.go
  • relay/common/override.go
  • relay/common/override_test.go
  • relay/common/relay_info.go
  • relay/common/request_plugin.go
  • relay/compatible_handler.go
  • relay/convert_request_error.go
  • relay/convert_request_error_test.go
  • relay/deepseek_tools_handler.go
  • relay/embedding_handler.go
  • relay/gemini_handler.go
  • relay/helper/common.go
  • relay/helper/reasoning_suffix.go
  • relay/helper/reasoning_suffix_test.go
  • relay/helper/stream_scanner.go
  • relay/image_handler.go
  • relay/relay_adaptor.go
  • relay/relay_task.go
  • relay/relay_task_test.go
  • relay/request_billing.go
  • relay/requestplugin/attachments.go
  • relay/requestplugin/attachments_test.go
  • relay/requestplugin/extract.go
  • relay/requestplugin/form.go
  • relay/requestplugin/media.go
  • relay/requestplugin/param_override.go
  • relay/requestplugin/pdf.go
  • relay/requestplugin/pdf_test.go
  • relay/requestplugin/plan.go
  • relay/requestplugin/record.go
  • relay/requestplugin/relay.go
  • relay/requestplugin/reply.go
  • relay/requestplugin/report.go
  • relay/requestplugin/requestplugin_test.go
  • relay/requestplugin/socket.go
  • relay/requestplugin/socket_test.go
  • relay/requestplugin/task_report.go
  • relay/rerank_handler.go
  • relay/responses_request.go
  • relay/responses_request_test.go
  • relay/responses_websocket.go
  • relaykit/dto/channel_settings.go
  • relaykit/dto/sensitive.go
  • relaykit/types/error.go
  • router/api-router.go
  • router/channel-router.go
  • router/channel_router_test.go
  • router/provider_plugin_gaps_test.go
  • router/provider_plugin_relay_test.go
  • service/channel.go
  • service/channel_select.go
  • service/codex_credential_refresh.go
  • service/log_info_generate.go
  • service/node_sync.go
  • service/node_sync_test.go
  • service/provider_plugin.go
  • service/provider_plugin_balance.go
  • service/provider_plugin_login.go
  • service/provider_plugin_login_test.go
  • service/provider_plugin_scheduled.go
  • service/provider_plugin_test.go
  • service/provider_plugin_token_test.go
  • service/quota.go
  • service/relay_error.go
  • service/sensitive.go
  • service/system_instance.go
  • service/system_task.go
  • service/task_billing.go
  • service/task_polling.go
  • service/task_polling_test.go
  • setting/billing_setting/tiered_billing.go
  • setting/billing_setting/tiered_billing_test.go
  • setting/operation_setting/system_task_setting.go
  • setting/request_plugin_setting/config.go
  • setting/sensitive.go
  • setting/task_plugin.go
  • setting/task_plugin_test.go
  • web/src/components/__tests__/command-menu.test.tsx
  • web/src/components/auto-group-order-item.tsx
  • web/src/components/confirm-dialog.tsx
  • web/src/features/channels/api.ts
  • web/src/features/channels/components/__tests__/channel-balance-cell.test.tsx
  • web/src/features/channels/components/__tests__/channel-configuration.test.tsx
  • web/src/features/channels/components/__tests__/channel-plugin-config-fields.test.tsx
  • web/src/features/channels/components/__tests__/channel-test-dialog-endpoints.test.tsx
  • web/src/features/channels/components/__tests__/multi-key-manage-dialog.test.tsx
  • web/src/features/channels/components/__tests__/plugin-login-callback.test.tsx
  • web/src/features/channels/components/__tests__/plugin-login-dialog.test.tsx
  • web/src/features/channels/components/__tests__/row-actions-query-balance.test.tsx
  • web/src/features/channels/components/channel-balance-details.tsx
  • web/src/features/channels/components/channel-quick-options.tsx
  • web/src/features/channels/components/channel-type-badge.test.tsx
  • web/src/features/channels/components/channel-type-badge.tsx
  • web/src/features/channels/components/channels-columns.tsx
  • web/src/features/channels/components/channels-primary-buttons.tsx
  • web/src/features/channels/components/data-table-row-actions.tsx
  • web/src/features/channels/components/dialogs/balance-query-dialog.tsx
  • web/src/features/channels/components/dialogs/channel-test-dialog.tsx
  • web/src/features/channels/components/dialogs/multi-key-manage-dialog.tsx
  • web/src/features/channels/components/dialogs/plugin-login-dialog.tsx
  • web/src/features/channels/components/dialogs/plugin-login-steps.tsx
  • web/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/src/features/channels/components/drawers/channel-plugin-config-fields.tsx
  • web/src/features/channels/components/drawers/channel-request-plugins-field.tsx
  • web/src/features/channels/components/drawers/plugin-credential-panel.tsx
  • web/src/features/channels/components/plugin-login-callback.tsx
  • web/src/features/channels/components/responses-websocket-setting.tsx
  • web/src/features/channels/constants.ts
  • web/src/features/channels/hooks/use-channel-mutate-form.ts
  • web/src/features/channels/hooks/use-plugin-login.ts
  • web/src/features/channels/hooks/use-task-plugin-option.ts
  • web/src/features/channels/lib/__tests__/plugin-login.test.ts
  • web/src/features/channels/lib/__tests__/task-plugin-channel-settings.test.ts
  • web/src/features/channels/lib/__tests__/update-all-balances.test.ts
  • web/src/features/channels/lib/channel-actions.ts
  • web/src/features/channels/lib/channel-balance.ts
  • web/src/features/channels/lib/channel-configuration.ts
  • web/src/features/channels/lib/channel-form.ts
  • web/src/features/channels/lib/plugin-login.ts
  • web/src/features/channels/types.ts
  • web/src/features/model-pricing/api.ts
  • web/src/features/model-pricing/model-pricing-panel.tsx
  • web/src/features/pricing/__tests__/pricing-controls.test.tsx
  • web/src/features/pricing/__tests__/sorting.test.ts
  • web/src/features/pricing/__tests__/task-price-display.test.tsx
  • web/src/features/pricing/components/cached-price-cell.tsx
  • web/src/features/pricing/components/model-card.tsx
  • web/src/features/pricing/components/model-details.tsx
  • web/src/features/pricing/components/model-price-cell.tsx
  • web/src/features/pricing/lib/billing-mode.ts
  • web/src/features/pricing/lib/filters.ts
  • web/src/features/pricing/lib/plugin-pricing.ts
  • web/src/features/pricing/types.ts
  • web/src/features/request-processing/__tests__/request-processing.test.tsx
  • web/src/features/request-processing/index.tsx
  • web/src/features/system-info/__tests__/node-sync-indicator.test.tsx
  • web/src/features/system-info/__tests__/system-instances-panel.test.tsx
  • web/src/features/system-info/api.ts
  • web/src/features/system-info/components/node-sync-indicator.tsx
  • web/src/features/system-info/components/system-instances-panel.tsx
  • web/src/features/system-info/constants.ts
  • web/src/features/system-info/hooks/use-node-sync.ts
  • web/src/features/system-info/lib/node-sync.ts
  • web/src/features/system-info/types.ts
  • web/src/features/system-settings/maintenance/__tests__/log-settings.test.tsx
  • web/src/features/system-settings/maintenance/log-settings-section.tsx
  • web/src/features/system-settings/models/__tests__/plugin-pricing.test.tsx
  • web/src/features/system-settings/models/model-pricing-core.ts
  • web/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/src/features/system-settings/models/task-plugin-pricing-editor.tsx
  • web/src/features/system-settings/operations/index.tsx
  • web/src/features/system-settings/operations/section-registry.tsx
  • web/src/features/system-settings/request-policies/__tests__/settings.test.tsx
  • web/src/features/system-settings/request-policies/defaults.ts
  • web/src/features/system-settings/request-policies/request-checks-section.tsx
  • web/src/features/system-settings/request-policies/section-registry.tsx
  • web/src/features/system-settings/security/index.tsx
  • web/src/features/system-settings/types.ts
  • web/src/features/task-plugins/__tests__/marketplace-install-dialog.test.tsx
  • web/src/features/task-plugins/__tests__/marketplace-panel.test.tsx
  • web/src/features/task-plugins/__tests__/marketplace-plugin-logo.test.tsx
  • web/src/features/task-plugins/__tests__/marketplace.test.ts
  • web/src/features/task-plugins/__tests__/plugin-card.test.tsx
  • web/src/features/task-plugins/__tests__/plugin-changelog-panel.test.tsx
  • web/src/features/task-plugins/__tests__/plugin-changelog.test.ts
  • web/src/features/task-plugins/__tests__/plugin-detail-sheet.test.tsx
  • web/src/features/task-plugins/__tests__/plugin-icon-file.test.ts
  • web/src/features/task-plugins/__tests__/plugin-kinds.test.tsx
  • web/src/features/task-plugins/__tests__/plugin-meta-preview.test.ts
  • web/src/features/task-plugins/__tests__/plugin-readme-section.test.tsx
  • web/src/features/task-plugins/__tests__/plugin-readme.test.ts
  • web/src/features/task-plugins/__tests__/plugin-site.test.ts
  • web/src/features/task-plugins/__tests__/plugins-table.test.tsx
  • web/src/features/task-plugins/__tests__/request-plugin-config-form.test.tsx
  • web/src/features/task-plugins/__tests__/request-plugin-dry-run.test.tsx
  • web/src/features/task-plugins/__tests__/request-plugin-run-line.test.tsx
  • web/src/features/task-plugins/__tests__/request-plugin-samples.test.ts
  • web/src/features/task-plugins/__tests__/request-plugin-try-panel.test.tsx
  • web/src/features/task-plugins/__tests__/text-diff.test.ts
  • web/src/features/task-plugins/__tests__/upload-dialog.test.tsx
  • web/src/features/task-plugins/__tests__/website.test.tsx
  • web/src/features/task-plugins/api.ts
  • web/src/features/task-plugins/components/community-plugin-reach.tsx
  • web/src/features/task-plugins/components/marketplace-capabilities.tsx
  • web/src/features/task-plugins/components/marketplace-install-dialog.tsx
  • web/src/features/task-plugins/components/marketplace-panel.tsx
  • web/src/features/task-plugins/components/marketplace-plugin-card.tsx
  • web/src/features/task-plugins/components/marketplace-source-menu.tsx
  • web/src/features/task-plugins/components/marketplace-sources-dialog.tsx
  • web/src/features/task-plugins/components/plugin-card.tsx
  • web/src/features/task-plugins/components/plugin-changelog-panel.tsx
  • web/src/features/task-plugins/components/plugin-code-lookup.tsx
  • web/src/features/task-plugins/components/plugin-detail-sheet.tsx
  • web/src/features/task-plugins/components/plugin-integrity-check.tsx
  • web/src/features/task-plugins/components/plugin-kind-switch.tsx
  • web/src/features/task-plugins/components/plugin-metadata-card.tsx
  • web/src/features/task-plugins/components/plugin-parts-badges.tsx
  • web/src/features/task-plugins/components/plugin-readme-section.tsx
  • web/src/features/task-plugins/components/plugin-relay-routes.tsx
  • web/src/features/task-plugins/components/plugin-transform-section.tsx
  • web/src/features/task-plugins/components/plugin-url-import-field.tsx
  • web/src/features/task-plugins/components/plugins-table.tsx
  • web/src/features/task-plugins/components/request-plugin-config-field.tsx
  • web/src/features/task-plugins/components/request-plugin-config-form.tsx
  • web/src/features/task-plugins/components/request-plugin-config-model-values.tsx
  • web/src/features/task-plugins/components/request-plugin-config-rows.tsx
  • web/src/features/task-plugins/components/request-plugin-dry-run-dialog.tsx
  • web/src/features/task-plugins/components/request-plugin-field-hint.tsx
  • web/src/features/task-plugins/components/request-plugin-instance-editor.tsx
  • web/src/features/task-plugins/components/request-plugin-picker.tsx
  • web/src/features/task-plugins/components/request-plugin-summary.tsx
  • web/src/features/task-plugins/components/request-plugin-try-panel.tsx
  • web/src/features/task-plugins/components/revoked-plugin-warning.tsx
  • web/src/features/task-plugins/components/source-diff.tsx
  • web/src/features/task-plugins/components/upload-dialog.tsx
  • web/src/features/task-plugins/index.tsx
  • web/src/features/task-plugins/lib/marketplace.ts
  • web/src/features/task-plugins/lib/plugin-changelog.ts
  • web/src/features/task-plugins/lib/plugin-document-problem.ts
  • web/src/features/task-plugins/lib/plugin-document.ts
  • web/src/features/task-plugins/lib/plugin-icon-file.ts
  • web/src/features/task-plugins/lib/plugin-kinds.ts
  • web/src/features/task-plugins/lib/plugin-meta-preview.ts
  • web/src/features/task-plugins/lib/plugin-name.ts
  • web/src/features/task-plugins/lib/plugin-parts.ts
  • web/src/features/task-plugins/lib/plugin-readme.ts
  • web/src/features/task-plugins/lib/plugin-site.ts
  • web/src/features/task-plugins/lib/plugin-url.ts
  • web/src/features/task-plugins/lib/request-plugin-samples.ts
  • web/src/features/task-plugins/lib/request-plugins.ts
  • web/src/features/task-plugins/lib/text-diff.ts
  • web/src/features/task-plugins/types.ts
  • web/src/features/usage-logs/components/__tests__/request-plugin-record.test.tsx
  • web/src/features/usage-logs/components/columns/common-logs-columns.tsx
  • web/src/features/usage-logs/components/dialogs/details-dialog.tsx
  • web/src/features/usage-logs/components/request-plugin-record.tsx
  • web/src/features/usage-logs/types.ts
  • web/src/hooks/use-sidebar-data.ts
  • web/src/i18n/locales/en.json
  • web/src/i18n/locales/fr.json
  • web/src/i18n/locales/ja.json
  • web/src/i18n/locales/ru.json
  • web/src/i18n/locales/vi.json
  • web/src/i18n/locales/zh-TW.json
  • web/src/i18n/locales/zh.json
  • web/src/lib/__tests__/format-bytes.test.ts
  • web/src/lib/format.ts
  • web/src/lib/query-client.ts
  • web/src/routeTree.gen.ts
  • web/src/routes/_authenticated/oauth/plugin/$key/callback.tsx
  • web/src/routes/_authenticated/request-processing/index.tsx
  • web/src/routes/_authenticated/system-settings/request-policies/$section.tsx
  • web/src/routes/_authenticated/system-settings/security/$section.tsx
  • web/src/routes/_authenticated/task-plugins/index.tsx
  • web/src/stores/plugin-site-store.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@Calcium-Ion
Calcium-Ion requested a review from RedwindA November 11, 2026 07:40
@Calcium-Ion
Calcium-Ion marked this pull request as ready for review November 11, 2026 07:57
@Calcium-Ion Calcium-Ion self-assigned this Nov 11, 2026
…ugin API

- Protocol names: ctx.format and samples use relaykit's protocol names.
  The spec lists the client paths and body of each name, so every host
  passes the same names to plugins.
- Host-specific members: channel, group, user, token, channelTypes,
  channelOther and utils.paramOverride exist only on new-api. The types
  mark them optional.
- Relay routes: the spec now writes out the route keys and the converters
  each incoming path accepts. The schema lists the converter names.
The site now marks official plugins as recommended in its index. The
built-in official and community lists both get a Recommended group;
lists added by the administrator still cannot recommend plugins.
…t answer

Plugin lists, plugin files and logos from www.newapi.ai are downloaded
from www.newapi.pro, the mainland China site, when newapi.ai gives no
answer within 10 seconds; the browser remembers this for a day. The
marketplace toolbar has a download site picker: Auto, or Mainland China
to always use www.newapi.pro. Saved source addresses stay on newapi.ai,
and every file is still checked against its sha256.

Community install counts go to newapi.ai first and to newapi.pro when
newapi.ai cannot be reached.
….newapi.pro

Reloading or leaving the marketplace cancels requests still running.
That was read as www.newapi.ai not answering, so the browser moved to
www.newapi.pro for a day although newapi.ai was reachable. Requests
cut off by leaving the page are no longer counted.
The marketplace no longer switches between plugin sites by itself. The
toolbar menu lists the main site www.newapi.ai, the backup site
www.newapi.pro and the other plugin lists; picking an entry is the only
thing that changes where plugins are downloaded from, and the main site
can always be picked again.

A browser that the earlier automatic switch had moved to www.newapi.pro
opens on the main site again. The download site, the source choice and
managing sources now share one menu in the list header.

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

🟡 Changes recommended

Delegated plugin-binding permissions expose full instance configurations, including root-configured service credentials, to non-root administrators.

4 open issues
What changed in this PR

This PR expands the gateway’s task-plugin system to support provider integrations and request processing, with a shared plugin center and community marketplace.

Changes:

  • Adds provider routing, plugin configuration, login integration, and request-processing hooks with usage-log records.
  • Adds community marketplace support, plugin-kind navigation, and node synchronization reporting.
  • Separates task and ordinary model pricing, removes legacy sensitive-word settings, and extends regression coverage.
File Description
web/​src/​stores/​plugin-site-store.ts Persists the selected plugin download site.
web/​src/​routes/​_authenticated/​task-plugins/​index.tsx Validates plugin-kind search parameters.
web/​src/​routes/​_authenticated/​system-settings/​security/​$section.tsx Redirects legacy sensitive-word settings.
web/​src/​routes/​_authenticated/​system-settings/​request-policies/​$section.tsx Redirects the former filtering section.
web/​src/​routes/​_authenticated/​request-processing/​index.tsx Adds the root-only request-processing route.
web/​src/​routes/​_authenticated/​oauth/​plugin/​$key/​callback.tsx Adds the plugin login callback page.
web/​src/​lib/​query-client.ts Refreshes synchronization status after mutations.
web/​src/​lib/​format.ts Adds decimal byte formatting.
web/​src/​lib/​__tests__/​format-bytes.test.ts Tests localized byte formatting.
web/​src/​hooks/​use-sidebar-data.ts Adds plugin-center and request-processing navigation.
web/​src/​features/​usage-logs/​components/​dialogs/​details-dialog.tsx Displays plugin records and administrative steps.
web/​src/​features/​usage-logs/​components/​columns/​common-logs-columns.tsx Marks logs affected by request plugins.
web/​src/​features/​task-plugins/​lib/​plugin-url.ts Uses the selected plugin download site.
web/​src/​features/​task-plugins/​lib/​plugin-site.ts Redirects supported downloads to the backup site.
web/​src/​features/​task-plugins/​lib/​plugin-parts.ts Resolves plugin capabilities with compatibility defaults.
web/​src/​features/​task-plugins/​lib/​plugin-name.ts Resolves localized plugin names.
web/​src/​features/​task-plugins/​lib/​plugin-meta-preview.ts Detects plugin parts from source.
web/​src/​features/​task-plugins/​lib/​plugin-kinds.ts Defines plugin categories and counts.
web/​src/​features/​task-plugins/​lib/​plugin-icon-file.ts Supports extensionless community icon files.
web/​src/​features/​task-plugins/​components/​upload-dialog.tsx Generalizes plugin upload copy.
web/​src/​features/​task-plugins/​components/​source-diff.tsx Allows custom diff labels and empty text.
web/​src/​features/​task-plugins/​components/​revoked-plugin-warning.tsx Displays community takedown warnings.
web/​src/​features/​task-plugins/​components/​request-plugin-field-hint.tsx Adds compact configuration-field hints.
web/​src/​features/​task-plugins/​components/​plugin-url-import-field.tsx Simplifies import guidance and errors.
web/​src/​features/​task-plugins/​components/​plugin-parts-badges.tsx Displays plugin capability badges.
web/​src/​features/​task-plugins/​components/​plugin-kind-switch.tsx Adds category selection with counts.
web/​src/​features/​task-plugins/​components/​plugin-integrity-check.tsx Simplifies integrity status explanations.
web/​src/​features/​task-plugins/​components/​marketplace-sources-dialog.tsx Distinguishes official, community, and third-party sources.
web/​src/​features/​task-plugins/​api.ts Adds instance APIs and marketplace source attribution.
web/​src/​features/​task-plugins/​__tests__/​website.test.tsx Updates fixtures for plugin categories.
web/​src/​features/​task-plugins/​__tests__/​upload-dialog.test.tsx Updates preview wording assertions.
web/​src/​features/​task-plugins/​__tests__/​text-diff.test.ts Tests request-text change highlighting.
web/​src/​features/​task-plugins/​__tests__/​request-plugin-run-line.test.tsx Tests plugin failure-behavior descriptions.
web/​src/​features/​task-plugins/​__tests__/​plugin-meta-preview.test.ts Tests source-based capability detection.
web/​src/​features/​task-plugins/​__tests__/​plugin-icon-file.test.ts Tests extensionless icon detection.
web/​src/​features/​task-plugins/​__tests__/​marketplace-plugin-logo.test.tsx Supplies category information to card fixtures.
web/​src/​features/​system-settings/​types.ts Removes legacy sensitive-word fields.
web/​src/​features/​system-settings/​security/​index.tsx Removes legacy sensitive-word defaults.
web/​src/​features/​system-settings/​request-policies/​section-registry.tsx Removes the former filtering section.
web/​src/​features/​system-settings/​request-policies/​defaults.ts Removes obsolete filtering configuration.
web/​src/​features/​system-settings/​models/​model-pricing-sheet.tsx Passes per-call pricing state and updates labels.
web/​src/​features/​system-settings/​models/​model-pricing-core.ts Distinguishes chat expressions from task prices.
web/​src/​features/​system-info/​types.ts Defines node synchronization response types.
web/​src/​features/​system-info/​lib/​node-sync.ts Derives synchronization labels and states.
web/​src/​features/​system-info/​hooks/​use-node-sync.ts Polls synchronization status for root users.
web/​src/​features/​system-info/​api.ts Fetches node synchronization status.
web/​src/​features/​pricing/​types.ts Adds ordinary-pricing metadata.
web/​src/​features/​pricing/​lib/​plugin-pricing.ts Separates ordinary and plugin pricing views.
web/​src/​features/​pricing/​lib/​filters.ts Uses ordinary prices for applicable filters and sorting.
web/​src/​features/​pricing/​lib/​billing-mode.ts Uses base pricing for billing labels.
web/​src/​features/​pricing/​components/​cached-price-cell.tsx Displays applicable base cache pricing.
web/​src/​features/​pricing/​__tests__/​sorting.test.ts Tests sorting models with both pricing paths.
web/​src/​features/​pricing/​__tests__/​pricing-controls.test.tsx Tests ordinary and task pricing categories.
web/​src/​features/​model-pricing/​model-pricing-panel.tsx Renames the ordinary-price label.
web/​src/​features/​model-pricing/​api.ts Adds provider-relay metadata to pricing variants.
web/​src/​features/​channels/​types.ts Adds balance details and plugin settings.
web/​src/​features/​channels/​lib/​channel-actions.ts Adds credential query keys and delayed balance refreshes.
web/​src/​features/​channels/​hooks/​use-task-plugin-option.ts Shares plugin lookup and channel capability checks.
web/​src/​features/​channels/​hooks/​use-channel-mutate-form.ts Returns created channel IDs for login flows.
web/​src/​features/​channels/​constants.ts Enables field controls for plugin channels.
web/​src/​features/​channels/​components/​responses-websocket-setting.tsx Accepts plugin-specific WebSocket support.
web/​src/​features/​channels/​components/​drawers/​channel-plugin-config-fields.tsx Renders schema-driven channel plugin settings.
web/​src/​features/​channels/​components/​dialogs/​balance-query-dialog.tsx Displays structured upstream balance details.
web/​src/​features/​channels/​components/​data-table-row-actions.tsx Uses plugin capabilities for channel actions.
web/​src/​features/​channels/​components/​channels-primary-buttons.tsx Displays channel synchronization status.
web/​src/​features/​channels/​components/​channel-type-badge.tsx Distinguishes provider plugins from task-only plugins.
web/​src/​features/​channels/​components/​channel-type-badge.test.tsx Tests capability-based plugin labels.
web/​src/​features/​channels/​components/​channel-quick-options.tsx Accepts plugin-specific capability overrides.
web/​src/​features/​channels/​components/​channel-balance-details.tsx Displays balance windows, timestamps, and errors.
web/​src/​components/​confirm-dialog.tsx Allows explicit focus restoration.
web/​src/​components/​auto-group-order-item.tsx Separates reorder identity from display name.
web/​src/​components/​__tests__/​command-menu.test.tsx Tests updated root navigation entries.
THIRD-PARTY-LICENSES.md Records new WebP and PDF dependencies.
setting/​task_plugin.go Adds community marketplace defaults and classification.
setting/​task_plugin_test.go Tests source classification and saved-list preservation.
setting/​sensitive.go Removes legacy sensitive-word settings.
setting/​request_plugin_setting/​config.go Stores synchronized request-plugin instances.
setting/​billing_setting/​tiered_billing_test.go Tests rejection of chat quantities in task expressions.
service/​task_billing.go Includes request-plugin records in task logs.
service/​system_instance.go Reports synchronization state and serializes snapshots.
service/​sensitive.go Removes legacy sensitive-word processing.
service/​relay_error.go Shares error logging with plugin-rejected requests.
service/​quota.go Returns the quota charged for Realtime responses.
service/​log_info_generate.go Adds public and administrative plugin records.
service/​codex_credential_refresh.go Signals channel changes after credential refresh.
service/​channel.go Notifies plugin scheduling after automatic disablement.
service/​channel_select.go Includes request paths in plugin identity constraints.
router/​channel-router.go Registers plugin login and credential routes.
router/​channel_router_test.go Tests plugin-route permissions.
router/​api-router.go Registers request-plugin and synchronization APIs.
relaykit/​types/​error.go Adds request-plugin rejection and failure codes.
relaykit/​dto/​sensitive.go Removes the legacy sensitive-word response type.
relaykit/​dto/​channel_settings.go Adds plugin settings and route-model matching support.
relay/​responses_request.go Integrates request plugins into Responses preparation.
relay/​rerank_handler.go Integrates request-plugin stages into reranking.
relay/​request_billing.go Removes legacy sensitive-word checks from billing preparation.
relay/​relay_adaptor.go Selects the provider-plugin adaptor.
relay/​image_handler.go Integrates request-plugin checks into image requests.
relay/​helper/​stream_scanner.go Finds keepalive writers through wrappers.
relay/​helper/​common.go Traverses wrapped keepalive writers.
relay/​gemini_handler.go Adds plugin stages to Gemini request paths.
relay/​embedding_handler.go Adds outbound and final embedding checks.
relay/​deepseek_tools_handler.go Supports provider plugins and request checks.
relay/​convert_request_error.go Preserves request-plugin error codes and statuses.
relay/​compatible_handler.go Adds plugin stages to compatible text requests.
relay/​common/​relay_info.go Tracks plugin effects and provider context.
relay/​common/​override.go Records overrides of plugin changes.
relay/​common/​override_test.go Tests plugin parameter-override header changes.
relay/​claude_handler.go Adds request-plugin stages to Claude requests.
relay/​alpha_search_handler.go Supports provider plugins and request checks.
plugins/​vertex_ai_region_test.go Tests channel-based Vertex AI region selection.
plugins/​tasks/​vertex-ai/​plugin.js Reads regions from the channel’s region field.
plugins/​tasks/​request-redact/​icon.svg Adds request-redaction artwork.
plugins/​tasks/​request-filter/​icon.svg Adds request-filter artwork.
plugins/​tasks/​param-override/​icon.svg Adds parameter-override artwork.
plugins/​tasks/​image-compress/​icon.svg Adds image-compression artwork.
plugins/​tasks/​content-moderation/​icon.svg Adds content-moderation artwork.
plugins/​tasks/​auto-reasoning/​icon.svg Adds automatic-reasoning artwork.
plugins/​builtin_plugins_test.go Tests built-in request-plugin contracts.
pkg/​jsplugin/​routing.go Separates provider-only models from task routing.
pkg/​jsplugin/​request.go Shares host validation with channel-less hooks.
pkg/​billingexpr/​expr.md Documents task and ordinary pricing boundaries.
pkg/​billingexpr/​compile.go Detects chat-quantity references in expressions.
oauth/​registry.go Reloads custom providers atomically.
model/​task.go Stores credential identity and task-report context.
model/​system_sync_topic.go Persists synchronization topic revisions.
model/​subscription.go Propagates subscription-plan cache invalidation.
model/​request_policy.go Removes legacy filtering and signals policy changes.
model/​request_policy_test.go Uses the exported options reload function.
model/​passkey_option.go Signals committed passkey-setting changes.
model/​model_pricing_conversion.go Recognizes ordinary provider-plugin pricing paths.
model/​model_metadata_sync.go Signals committed metadata changes.
model/​model_meta.go Signals model and channel changes after deletion.
model/​main.go Registers the synchronization-topic migration.
model/​log.go Makes settled consumption available to report hooks.
model/​custom_oauth_provider.go Signals OAuth provider mutations.
model/​channel_priority.go Signals committed priority changes.
model/​channel_constraint.go Admits eligible provider-plugin routes and WebSockets.
model/​channel_constraint_test.go Tests provider-plugin WebSocket eligibility.
model/​channel_cache.go Serializes channel cache reloads.
model/​channel_balance.go Persists structured channel balance results.
model/​auth_flow.go Adds plugin-login flows and conditional payload updates.
model/​ability.go Signals channel changes after ability repair.
middleware/​distributor.go Pins provider plugins for selected channels.
middleware/​access_token_routes.go Adds scopes for synchronization and request-plugin APIs.
i18n/​locales/​zh-TW.yaml Adds Traditional Chinese plugin messages.
i18n/​locales/​zh-CN.yaml Adds Simplified Chinese plugin messages.
i18n/​locales/​en.yaml Adds English plugin messages.
i18n/​keys.go Defines new plugin message keys.
go.sum Records new dependency checksums.
go.mod Adds PDF and WebP libraries and updates dependency classification.
controller/​user.go Signals authorization changes after user mutations.
controller/​task.go Supplies channel identity to artifact adaptors.
controller/​system_info.go Exposes node synchronization status.
controller/​plugin_protocol.go Adds submission reports and preserves plugin rejections.
controller/​plugin_protocol_image.go Adds image-task submission reporting.
controller/​option.go Blocks instance writes through general settings.
controller/​model_meta.go Signals model metadata changes.
controller/​codex_usage.go Signals persisted credential updates.
controller/​channel_task_plugin_validation_test.go Tests request-plugin channel bindings.
controller/​channel_authz.go Treats balance details as read-only.
constant/​env.go Defines the plugin memory limit.
constant/​context_key.go Adds provider and consumption context keys.
constant/​api_type.go Defines the provider-plugin API type.
common/​init.go Loads the plugin memory limit from the environment.
common/​gin.go Masks provider-plugin upstream addresses.
common/​api_type.go Extends Responses compact support to provider plugins.
.env.example Documents plugin memory configuration.

Review effort: Balanced

Comment thread router/api-router.go Resolved
Comment thread relay/compatible_handler.go Resolved
Every marketplace plugin version now ships a usage guide, README.md, and a
changelog, CHANGELOG.md, next to plugin.js. The install dialog shows the
guide in the reader's language when a translation is listed, falls back to
English, and links to the source file. A guide or changelog that breaks the
format is reported with its file, line and rule instead of being shown.

The plugin API document describes both formats, the translations they may
list, and the checks the community marketplace runs before it accepts a
version: readme_missing, readme_invalid, changelog_missing and
changelog_invalid. Versions accepted before these checks are not checked
again.
- Only the root user reads request plugin instance configs; an admin who
  may bind instances to channels gets them without configs.
- Outbound hooks that grow the body are held to MAX_REQUEST_BODY_MB, as
  ingress hooks are, and answer 413 without a retry.
- An admin who cannot read plugin options keeps the balance and model
  list actions on plugin channels; the server answers whether they work.
- Reading the parts of a plugin source gives up when the source does not
  parse or code elsewhere refers to meta, as the meta preview does.

@RedwindA RedwindA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

审的是 6f9c2f6,又看了 bb7c7b9 的改动:Copilot 提的四条(instances 配置泄露、outbound 的 413、余额操作的权限判断、meta 被后续赋值)已经修好,下面不再列。其余问题都对照代码核过,bb7c7b992 没有动到相关文件。标"实测"的是在本地实例上复现过的。行号对应 bb7c7b9。

合并前需要修

  1. 畸形 PDF 能让进程崩溃(实测)。relay/requestplugin/pdf.go:1112 的 checkPDF 只在 /DecodeParms 是直接字典时检查 /Columns。写成间接引用(/DecodeParms 6 0 R,对象 6 是 << /Predictor 12 /Columns 1099511627776 >>)就能通过检查,pdf 库随后按 Columns 分配缓冲区,进程直接报 fatal error: runtime: out of memory,recover 拦不住。只要有一个读附件的实例(包括迁移出来的 request-filter),任何 API 用户发一个 829 字节的 PDF 就能打挂网关。
  2. 畸形 PDF 让解析死循环(实测)。pdf.go:1119 只量对象流解压后的大小,不检查 /N。/N 设得极大时,库在 resolve 里循环,不再调用 ReadAt,deadline 永远不会触发,客户端断开后也不停。这样的请求发两个就占满 documentSlots(容量 2),之后所有文档附件都返回 unchecked: busy,request-filter 直接放行:含过滤词的 PDF 等 5 秒后会被转发给上游。建议 checkPDF 先解析间接引用再检查参数,或者 fork 这个库,在 EOF 和 resolve 循环里加上限。
  3. Content-Type: application/jsonl 能绕过请求处理插件(实测)。relay/requestplugin/relay.go:458 的 jsonRequest 只认 application/json 和 +json,网关解析请求体时用的却是 HasPrefix("application/json")。ingress 因此记成 unchecked、不执行,只导出 ingress 的 content-moderation 被绕过。渠道开了请求体透传时 egress 也会跳过:迁移出的敏感词实例完全失效,main 拦截的请求在这里返回 200,上游收到原文。
  4. 任务插件总开关关闭时,所有请求处理实例都静默失效(实测)。plan.go:151 里插件不可用又不算 unavailable,实例直接被跳过:没有报错,也没有记录,实例列表照样显示"启用"。迁移却不管这个开关,照样删除旧的敏感词设置。站点原来关着任务插件、开着敏感词,升级后过滤就没了。
  5. 迁移后的过滤范围和旧检查不等价(实测,三种数据库结果一致)。旧检查扫的是 CombineText。request-filter/plugin.js:172 的 collectTexts 不看以下字段,它们升级前会被拦,升级后会直接到上游:工具的名称、描述和参数 schema,assistant tool_calls 的参数,Claude tool_use 的 input,Gemini 的 functionDeclarations 和 functionResponse,rerank 的 query 和 documents。反过来,PDF/DOCX 里的词现在会被拦,旧检查不拦。要么补齐这些字段,要么在升级说明里写清楚。
  6. 回复检查改写 Gemini 的多 part 回复(实测)。reply.go:622-675 把一个 candidate 的所有文本 part 当成一个 output,结果 [text A, inlineData, text B] 变成 [text A+B, inlineData, text ""],插件返回 pass 时也一样。迁移出的实例(replies: false)导出了 reply,所以开过敏感词的站点升级后就会遇到。
  7. 渠道状态每变一次都会触发全量重载渠道缓存(实测)。model/channel.go:755 只要状态有变化(包括多 key 渠道里单个 key 被禁用)就 bump channels topic,每个节点(包括发起写入的节点和单节点站点)都会在 3 秒内跑一次 InitChannelCache()。main 上只按 SYNC_FREQUENCY 跑。渠道多、key 状态频繁变化的站点开销明显增加,而且和装不装插件无关。
  8. json.patch 的 copy 能按指数放大请求体。pkg/requestpatch/patch.go:674 允许从根复制,512 个操作的上限挡不住,16 次复制就能把 1 KB 变成 66 MB,分配发生在 Go 侧,不受 JS 内存上限限制。provider 的 prepareRequest 也走这里。
  9. 图片计费字段保护只认标准字段名。relay/common/request_plugin.go:166 的 billingFields 在协议转换之后才比较,只认 n、size 这类名字。SiliconFlow 的 batch_size、Imagen 的 parameters.sampleCount、Replicate 的 input.num_outputs 都能被 outbound 插件改大,而 image_handler.go:119 只重新读 n,预扣还是按原来的数量。
  10. 凭据刷新时持锁等网络。service/provider_plugin.go:214 在 UpdateChannelLocked 里调用 refresh(最长 60 秒)。另一个写入方如果先拿了轮询锁、再去等这把锁,多 key 渠道上所有请求都会卡在 GetNextEnabledKey。MySQL 默认 50 秒锁等待,used_quota 的更新还可能因超时丢掉。
  11. needs_login 的 key 会一直被选中。providerplugin/adaptor.go:550 返回 skip-retry。自动禁用默认关闭,这个 key 不会被禁用,选到它的请求直接失败,也不会换别的渠道。

也建议修

  • 413 还差 provider 这一路:providerplugin/adaptor.go:722 的 prepareRequest effects 改写后不检查 MAX_REQUEST_BODY_MB。
  • auto 分组的令牌永远不会命中按分组生效的实例:各阶段读的都是 ContextKeyUsingGroup(值是字面上的 auto),没读 ContextKeyAutoGroup,和 v1.md 里写的 late ingress 不符。
  • param_override.go:51 把渠道 header override 的原值放进 DSL 上下文,插件可以用 sync_fields 从 header:X 拷进 body 读到。
  • 余额 hook 的 URL 不受 allowedHosts 限制,只有任务部分的插件也能导出余额 hook,把渠道 key 发到任意主机。
  • PDF 资源消耗:ToUnicode CMap 的 codespace range 没有数量上限,decode 时每个字节都要全扫一遍(pdf.go:456);addRange 在目标为空串或数组时不写入映射,len(m.codes) 的上限也就不起作用,循环可以跑满 2^32 次(pdf.go:410)。两处都不检查 deadline。
  • WebP:VP8X 的画布尺寸可以伪造(media.go:189),DecodeConfig 读到 1x1,Decode 解出的是真实帧,像素上限被绕过。image-compress 的默认无损模式会把每张 ≥500KB 的 JPEG 都重编码一遍,结果几乎总是更大而被丢掉。
  • keywords.go:106 用 MultiPatternSearch(..., false),先收集全部命中再截取 32 个,大请求里重复关键词会多分配几百 MB。
  • report 实例只要存在,所有请求都会装 responseCapture(relay.go:75,在判断范围之前)。另外 SocketIngress 先设的 socket capture 会被这里覆盖,WebSocket 的 report 因此被当成非流式处理。
  • 节点同步:
    • BumpSyncTopic 和数据写入不在同一事务里,注释说有周期重载兜底,但 OAuth 提供方没有周期重载,bump 失败后这次修改永远同步不到别的节点;
    • StartNodeSync 不管启动时加载是否成功都把 topic 标成已同步;
    • GetNodeSyncStatus 用应答节点的 topic 列表去判断其他节点,没注册 channels 的节点会一直显示未同步,前端因此每 3 秒轮询一次。
  • request-redact 改动超过 512 个字段时请求返回 500;content-moderation 要审的文本超过 1 MiB 时 fetch 抛错,同样返回 500。
  • provider 流在首个输出之后,被插件丢弃的上游事件不会重置 STREAMING_TIMEOUT,上游还在发数据,流就被截断了(stream.go:150)。

需要在 PR 描述或升级说明里写清楚的行为变化

  • 命中敏感词时从 500 sensitive_words_detected 变成 400 request_rejected。
  • 迁移删除了旧设置,回滚到旧版本后敏感词检查会静默关闭。
  • "更新全部余额"改成异步、4 并发执行。
  • content-moderation 在审核服务出错时一律拒绝,没有放行选项。

补跑的验证

  • 三库升级:SQLite、PostgreSQL 9.6.24、MySQL 5.7.44 上,先用 bd6bb53 建库并开启敏感词,再升级到 6f9c2f6。三个库都只新建了 system_sync_topics,第二次启动没有 DDL,迁移结果一致,没有重复实例,基线请求的扣费和升级前相同。
  • 没装插件时,单请求 CPU 和 main 在噪声范围内。迁移出的实例和旧检查相比,300 KiB 的请求每个多约 13% CPU(约 40ms 对 45ms)。

…s and node sync

- PDF checks resolve indirect parameters and bound every value the parser
  allocates or loops on: predictor columns, object stream counts, nested
  object streams, cross-reference streams and ToUnicode ranges. Font and
  CMap work checks the deadline.
- A WebP frame must match its declared canvas, and keyword search stops at
  its match limit.
- Request processing treats a body as JSON whenever the gateway parses it
  as JSON, keeps Gemini reply parts in place, scopes instances by the
  settled auto group, hides channel header overrides from plugin param
  overrides, and captures replies only for report instances in scope.
- Request processing no longer follows the plugin master switch, which now
  covers plugin tasks and channels only.
- json.patch copies stop at MAX_REQUEST_BODY_MB, and provider prepareRequest
  effects past it answer 413.
- Image billing reads the count from the final upstream body, including the
  count members of SiliconFlow, Imagen and Replicate and the Imagen default.
- Automatic channel status changes no longer reload every node's channel
  cache. A credential refresh holds no channel lock while it waits on the
  vendor. A key that needs login is disabled and the request can retry.
- Balance requests must go to the channel host or allowedHosts, and provider
  stream events a plugin drops keep the stream alive.
- Node sync: OAuth provider writes bump inside their transaction, a failed
  startup load is retried, and each node is judged by its own topics.
- request-filter checks the text the old sensitive-word check did,
  request-redact and content-moderation handle large inputs, and
  image-compress lossless mode leaves JPEG and WebP alone.

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

Comment thread model/channel_balance.go Resolved
Comment thread relay/relay_adaptor.go
Comment on lines +127 to +128
case constant.APITypeProviderPlugin:
return &providerplugin.Adaptor{}
Comment thread relay/responses_request.go Resolved
Comment thread plugins/tasks/vertex-ai/plugin.js Resolved
- Channel other_info writes (status changes, balance queries and manual
  multi-key actions) only land while other_info is still the value read,
  and retry otherwise, so a write on one node no longer overwrites another
  node's balance or status reason. They write only their own columns.
- On the Responses path egress reads the body after the channel finalizes
  it, which is the body sent upstream.
- The Vertex AI plugin picks the region by the model the client asked for,
  as the built-in Vertex AI channel does.
- /request-processing and /security are reserved route namespaces, and a
  test checks that every console page is reserved.
- The plugin API docs say what egress reads on a provider plugin channel.
"Update all balances" now queues a channel_balance system task instead of
starting a goroutine guarded by an in-process flag. The task row holds the
progress (enabled channels queried of total), so any node can answer it,
and its active key keeps one run at a time across nodes. The
CHANNEL_UPDATE_FREQUENCY schedule becomes the same task's schedule, so
manual and scheduled runs no longer overlap.

GET /api/channel/update_balance answers with the task id, and with the
running one when a run is already queued. GET
/api/channel/update_balance/task/:task_id, under the same channel
permission, returns the status, progress and failure of balance update
tasks only. The channel list follows the task, reloads as more channels
are queried and once more at the end, and reports how the run ended.
Node sync no longer needs its own table. A write to synced data adds a
pending sync_<topic> system task. Every node polls the newest task of each
topic it keeps every 3 s and reloads when that task is newer than the one
it applied. Custom OAuth providers still add their task inside the write
transaction, and lock the newest task of the topic first, so tasks commit
in id order. The master marks a sync task succeeded once every online node
that keeps the topic has applied it. Until then the task shows how many
nodes have applied it and why the others have not. The
system_sync_topics table is gone.

A composite (type, id) index answers the newest task of a type from the
index. The latest-per-type and earliest-pending queries now read ids first,
because MySQL 5.7 scanned the whole table for them.

A daily system_task_cleanup task deletes finished system tasks older than
system_task_setting.retention_days (default 30, at least 1), in batches.
It never deletes active tasks or the newest task of any type. The
retention is set under Operations > Log maintenance.
- Adopt the MoeForge moejs v0.1.0 and moego v0.1.0-alpha.2 upgrade; plugin
  code now imports github.com/MoeForge/moejs and uses moego/regexp.
- Image pass-through keeps validating the vendor count member (for example
  SiliconFlow batch_size) while reading the stored body on demand.
- moejs v0.1.0 counts the memory a hook call keeps, not garbage it already
  dropped; the memory-limit tests now keep memory, and the plugin API doc and
  comments describe the new behavior.
@Calcium-Ion
Calcium-Ion merged commit 7b857f5 into main Nov 12, 2026
3 checks passed
@Calcium-Ion Calcium-Ion mentioned this pull request Nov 12, 2026
8 of 13 tasks
@Calcium-Ion
Calcium-Ion deleted the feat/provider-plugins branch November 12, 2026 13:52
Calcium-Ion added a commit that referenced this pull request Nov 12, 2026
The Vertex AI plugin now reads the channel deployment region (#8271), which the published 1.3.0 does not. Give that code its own version so the built-in plugin matches the marketplace again.
catroll added a commit to catroll/new-api that referenced this pull request Nov 12, 2026
Upstream published 8 commits after v1.0.0-rc.49 (2026-11-08 .. 2026-11-12,
444 files): the plugin system (QuantumNous#8271), request-body streaming with the
MoeForge moejs/moego migration (QuantumNous#8311), EPay RSA signing (QuantumNous#8291), HOST
listen address (QuantumNous#8269), channel model-redirect sync reset (QuantumNous#8304),
DeepSeek developer-role mapping (QuantumNous#8287), the risk-acknowledgement
composition fix, legal-consent i18n, and the retirement of the
sensitive-words subsystem, whose words a startup migration moves into a
request-filter instance (model.MigrateSensitiveWords).

Conflict resolution:
- controller/option.go: keep the fork's `_key` suffix filter (it hides
  payment_setting.epay_merchant_private_key) and allowlist
  payment_setting.epay_platform_public_key, which upstream deliberately
  returns to the admin UI.
- main.go: keep both the exchange-rate job and upstream's channel-update
  comment.
- model/channel.go: keep the fork's group-list validation, take
  upstream's "stored key list" comment, and import both time and
  unicode/utf8.
- billing/index.tsx: keep the fork's version (defaults live in
  default-settings.ts); port upstream's three payment_setting.epay_*
  defaults into that file.
- i18n locales (7 files): per-key three-way merge plus i18n:sync; nothing
  upstream added is lost, and zh-TW "Phone number" takes upstream's
  wording.

Follow-ups the merged tests required:
- adapt upstream's epay-sign-settings and payment-price-sync tests to the
  fork's extended payment form fields;
- add the missing PriceFollowsExchangeRate entry to the payment form's
  save baseline, so saving stops rewriting that option on every save
  (upstream's call-count assertions caught it; this also removes one
  pre-existing type error).
yang-yang9 pushed a commit to yyangTeam/new-api that referenced this pull request Nov 14, 2026
…marketplace (QuantumNous#8271)

* feat(plugins): add provider plugins, request plugins and a community marketplace

- Provider plugins turn an upstream vendor into a channel type: routes,
  protocol conversion, models, static keys, sign-in flows with token
  refresh, balance queries, per-channel config and a scheduled hook.
- Request plugins run on requests and replies (ingress, request,
  outbound, egress, reply, report), with instances by scope, model
  ranges, dry runs and per-log records. Built-ins: request filter,
  request redaction, parameter override, auto reasoning effort, image
  compression and content moderation. Sensitive words move into a
  request filter instance on first start.
- Node sync: a system_sync_topics table lets every node reload settings,
  channels, plugins and other data within seconds, and the system info
  page shows each node's state.
- Marketplace: a community source next to the official one, lookup by
  plugin code for official and community plugins, key rules for
  community plugins, install counts and takedown warnings.

* docs(plugins): name request protocols and host-only members in the plugin API

- Protocol names: ctx.format and samples use relaykit's protocol names.
  The spec lists the client paths and body of each name, so every host
  passes the same names to plugins.
- Host-specific members: channel, group, user, token, channelTypes,
  channelOther and utils.paramOverride exist only on new-api. The types
  mark them optional.
- Relay routes: the spec now writes out the route keys and the converters
  each incoming path accepts. The schema lists the converter names.

* feat(plugins): show recommended plugins from the official list too

The site now marks official plugins as recommended in its index. The
built-in official and community lists both get a Recommended group;
lists added by the administrator still cannot recommend plugins.

* feat(plugins): fall back to www.newapi.pro when www.newapi.ai does not answer

Plugin lists, plugin files and logos from www.newapi.ai are downloaded
from www.newapi.pro, the mainland China site, when newapi.ai gives no
answer within 10 seconds; the browser remembers this for a day. The
marketplace toolbar has a download site picker: Auto, or Mainland China
to always use www.newapi.pro. Saved source addresses stay on newapi.ai,
and every file is still checked against its sha256.

Community install counts go to newapi.ai first and to newapi.pro when
newapi.ai cannot be reached.

* fix(plugins): leaving the page does not switch the plugin site to www.newapi.pro

Reloading or leaving the marketplace cancels requests still running.
That was read as www.newapi.ai not answering, so the browser moved to
www.newapi.pro for a day although newapi.ai was reachable. Requests
cut off by leaving the page are no longer counted.

* feat(plugins): choose the plugin download site by hand

The marketplace no longer switches between plugin sites by itself. The
toolbar menu lists the main site www.newapi.ai, the backup site
www.newapi.pro and the other plugin lists; picking an entry is the only
thing that changes where plugins are downloaded from, and the main site
can always be picked again.

A browser that the earlier automatic switch had moved to www.newapi.pro
opens on the main site again. The download site, the source choice and
managing sources now share one menu in the list header.

* feat(plugins): show plugin usage guides and require README and changelog

Every marketplace plugin version now ships a usage guide, README.md, and a
changelog, CHANGELOG.md, next to plugin.js. The install dialog shows the
guide in the reader's language when a translation is listed, falls back to
English, and links to the source file. A guide or changelog that breaks the
format is reported with its file, line and rule instead of being shown.

The plugin API document describes both formats, the translations they may
list, and the checks the community marketplace runs before it accepts a
version: readme_missing, readme_invalid, changelog_missing and
changelog_invalid. Versions accepted before these checks are not checked
again.

* fix(plugins): address review findings on plugin parts, limits and access

- Only the root user reads request plugin instance configs; an admin who
  may bind instances to channels gets them without configs.
- Outbound hooks that grow the body are held to MAX_REQUEST_BODY_MB, as
  ingress hooks are, and answer 413 without a retry.
- An admin who cannot read plugin options keeps the balance and model
  list actions on plugin channels; the server answers whether they work.
- Reading the parts of a plugin source gives up when the source does not
  parse or code elsewhere refers to meta, as the meta preview does.

* fix(plugins): address review findings on request processing, documents and node sync

- PDF checks resolve indirect parameters and bound every value the parser
  allocates or loops on: predictor columns, object stream counts, nested
  object streams, cross-reference streams and ToUnicode ranges. Font and
  CMap work checks the deadline.
- A WebP frame must match its declared canvas, and keyword search stops at
  its match limit.
- Request processing treats a body as JSON whenever the gateway parses it
  as JSON, keeps Gemini reply parts in place, scopes instances by the
  settled auto group, hides channel header overrides from plugin param
  overrides, and captures replies only for report instances in scope.
- Request processing no longer follows the plugin master switch, which now
  covers plugin tasks and channels only.
- json.patch copies stop at MAX_REQUEST_BODY_MB, and provider prepareRequest
  effects past it answer 413.
- Image billing reads the count from the final upstream body, including the
  count members of SiliconFlow, Imagen and Replicate and the Imagen default.
- Automatic channel status changes no longer reload every node's channel
  cache. A credential refresh holds no channel lock while it waits on the
  vendor. A key that needs login is disabled and the request can retry.
- Balance requests must go to the channel host or allowedHosts, and provider
  stream events a plugin drops keep the stream alive.
- Node sync: OAuth provider writes bump inside their transaction, a failed
  startup load is retried, and each node is judged by its own topics.
- request-filter checks the text the old sensitive-word check did,
  request-redact and content-moderation handle large inputs, and
  image-compress lossless mode leaves JPEG and WebP alone.

* fix(plugins): address the second review on balances, egress and routes

- Channel other_info writes (status changes, balance queries and manual
  multi-key actions) only land while other_info is still the value read,
  and retry otherwise, so a write on one node no longer overwrites another
  node's balance or status reason. They write only their own columns.
- On the Responses path egress reads the body after the channel finalizes
  it, which is the body sent upstream.
- The Vertex AI plugin picks the region by the model the client asked for,
  as the built-in Vertex AI channel does.
- /request-processing and /security are reserved route namespaces, and a
  test checks that every console page is reserved.
- The plugin API docs say what egress reads on a provider plugin channel.

* feat(channels): run the balance update as a system task with progress

"Update all balances" now queues a channel_balance system task instead of
starting a goroutine guarded by an in-process flag. The task row holds the
progress (enabled channels queried of total), so any node can answer it,
and its active key keeps one run at a time across nodes. The
CHANNEL_UPDATE_FREQUENCY schedule becomes the same task's schedule, so
manual and scheduled runs no longer overlap.

GET /api/channel/update_balance answers with the task id, and with the
running one when a run is already queued. GET
/api/channel/update_balance/task/:task_id, under the same channel
permission, returns the status, progress and failure of balance update
tasks only. The channel list follows the task, reloads as more channels
are queried and once more at the end, and reports how the run ended.

* feat(system): sync nodes through system tasks and clean up task history

Node sync no longer needs its own table. A write to synced data adds a
pending sync_<topic> system task. Every node polls the newest task of each
topic it keeps every 3 s and reloads when that task is newer than the one
it applied. Custom OAuth providers still add their task inside the write
transaction, and lock the newest task of the topic first, so tasks commit
in id order. The master marks a sync task succeeded once every online node
that keeps the topic has applied it. Until then the task shows how many
nodes have applied it and why the others have not. The
system_sync_topics table is gone.

A composite (type, id) index answers the newest task of a type from the
index. The latest-per-type and earliest-pending queries now read ids first,
because MySQL 5.7 scanned the whole table for them.

A daily system_task_cleanup task deletes finished system tasks older than
system_task_setting.retention_days (default 30, at least 1), in batches.
It never deletes active tasks or the newest task of any type. The
retention is set under Operations > Log maintenance.
yang-yang9 pushed a commit to yyangTeam/new-api that referenced this pull request Nov 14, 2026
The Vertex AI plugin now reads the channel deployment region (QuantumNous#8271), which the published 1.3.0 does not. Give that code its own version so the built-in plugin matches the marketplace again.
yang-yang9 pushed a commit to yyangTeam/new-api that referenced this pull request Nov 14, 2026
Merged 44 upstream commits from origin/main into dev, rebased onto the
current origin/dev tip (includes PR #11 homepage identity work). An
earlier local attempt had merged into a stale dev chain that missed the
pushed homepage commits; this merge is the correct one.

Conflict resolution (14 files):
- Dockerfile: kept dev's ARG VERSION fallback, adopted main's
  MoeForge/moejs build path (go.mod is MoeForge on both sides)
- controller/relay.go: kept dev's service.IncrementChannelError and
  added main's requestplugin.Stopped else-if branch
- i18n/keys.go: union of dev's channel notify keys and main's new
  MsgChannelNotifyScheduledSubject
- model/request_policy.go: kept dev's superset case list
- web/package.json: dev's test/e2e scripts and deps + main's newer
  versions (@rsbuild/core 2.2.0, @types/react 19.2.18, jsdom ^30)
- web/bun.lock: regenerated via bun install
- 7 locale JSONs: key union (323 dev-side keys kept incl. homepage,
  450 main keys added, shared keys take main's value)
- web/src/routeTree.gen.ts: kept deleted (gitignored, routes:gen CI
  step regenerates it)

Dev customizations preserved (audited):
- image-gen embed page (option.go 13 hits, sidebar-data 4,
  sidebar-config 2)
- channel error notifications (Channel error alert in
  request-policies/channel-health-section.tsx; consecutive_error/
  error_rate/latest_error keys in backend yaml)
- in-panel system update + rollback (update-checker-section 33 hits)
- dev-created files intact: system_update.go, update_check.go,
  feishu_notify.go, qqbot_notify.go, channel_error_counter.go,
  notify-limit.go, scripts/version.sh
- CI: backend-tests.yml still without -race; routes:gen step intact;
  bun 1.4.4 consistent across workflows
- homepage identity work from PR #11 auto-merged (immersive landing,
  home-immersive.css, locale keys)

Main features adopted:
- provider/request plugins + community marketplace (QuantumNous#8271)
- task plugins at vendors' own /v1 paths (QuantumNous#8117)
- MoeForge moego v0.1.0-alpha.3 (no-AVX SIGILL fix), streaming reads
- doubao-seedream-5-5-261028, Gemini Omni 1.2 Flash on Vertex
- DeepSeek search/crawl options, developer->system role mapping,
  Responses reasoning backfill
- epay RSA signing, HOST env, HTTP/2 health checks (opt-in)
- security: Redis auth cache integrity, 2FA lockout reset,
  DOMPurify 3.4.17, go-jose 4.1.6, password validation improvements
- pricing change review before save; frontend deps upgrade (QuantumNous#6999)

Fork test fixes for upstream API changes:
- middleware/coverage_test.go: gjson import aliased to
  MoeForge/moego/ojson (drop-in)
- controller/coverage_test.go: getVertexArrayKeys now returns
  (keys, indices, err)
- setting/sensitive_test.go deleted (upstream retired the sensitive
  word check; replaced by request-policy blocked keywords + migration)
- web coverage-tests: dropped PASSWORD_MAX_LENGTH assertion (removed
  by QuantumNous#6928), dropped getModeVariant tests (export removed)

Verification:
- go build ./... passes (GOPROXY=goproxy.cn)
- relaykit and tokenkit standalone builds + vet pass (GOWORK=off)
- go vet ./... clean in all three modules
- bun install succeeds; bun run typecheck: zero errors (2,013 files)
- bun run i18n:check: all t() keys exist and translated

Co-Authored-By: Claude Code <[email protected]>
therealemery added a commit to therealemery/new-api that referenced this pull request Nov 16, 2026
* Merge commit from fork

MaskSensitiveInfo trimmed trailing punctuation one byte at a time and
recounted the parentheses of the whole URL for each trailing ')'. Trim
the punctuation set, including ')', with strings.TrimRight; the trimmed
characters are still appended after the masked URL.

* Merge commit from fork

Upgrade @visactor/vchart and @visactor/react-vchart to 2.1.7. Since 2.1.6
the DOM tooltip renders the title as text (VisActor/VChart#4640).

* fix: unmount authenticated layout on sign-out to stop credential-less refetches (QuantumNous#8110)

* Merge commit from fork

Cap zstd windows at 8 MiB and the request body limit. Disable asynchronous decoding to avoid consuming bodies before downstream middleware accepts the request.

Port the complete zstd fix and regression tests from the related advisory PR without importing unrelated commits.

Validation in this repository with Go 1.26.10:
GOMAXPROCS=2 go test -p 2 ./middleware -count=1 -timeout=180s
GOMAXPROCS=1 go test -p 1 ./middleware -run '^TestDecompressRequestZstd' -count=1 -timeout=60s -v
go mod verify
All passed, including 14 decoding cases and early rejection without reading the body.

* fix(logger): keep gin access and recovery logs on the current log file after rotation (QuantumNous#8098)

The gin access logger and panic recovery captured gin.DefaultWriter and
gin.DefaultErrorWriter when the server was built. Since log rotation closes
the previous file, every [GIN] access line and [Recovery] stack after the
first rotation reached stdout/stderr only and never any log file.

Both middlewares now write through common.LogWriter / common.ErrorLogWriter,
which forward each write to the current gin writers under LogWriterMu, so
rotation can swap and close files without losing lines or leaking the old fd.
The server-wide recovery moves from main.go to middleware.PanicRecover so the
production wiring is covered by the regression test.

* fix: save Turnstile keys before enabling (QuantumNous#7960)

* chore(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6 (QuantumNous#8112)

Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Commits](go-jose/go-jose@v4.1.4...v4.1.6)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-version: 4.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump undici in /electron (QuantumNous#8006)

Bumps  and [undici](https://github.com/nodejs/undici). These dependencies needed to be updated together.

Updates `undici` from 7.30.0 to 7.30.1
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v7.30.0...v7.30.1)

Updates `undici` from 6.29.0 to 6.29.1
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v7.30.0...v7.30.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.30.1
  dependency-type: indirect
- dependency-name: undici
  dependency-version: 6.29.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump electron from 41.10.6 to 42.11.16 in /electron (QuantumNous#8008)

Bumps [electron](https://github.com/electron/electron) from 41.10.6 to 42.11.16.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](electron/electron@v41.10.6...v42.11.16)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 42.11.16
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump fast-uri from 3.1.7 to 3.1.9 in /electron (QuantumNous#8007)

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.7...v3.1.9)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump tailwind-merge from 3.6.0 to 3.7.0 in /web (QuantumNous#8106)

Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge/tree/HEAD/packages/tailwind-merge) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/commits/[email protected]/packages/tailwind-merge)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump knip from 6.27.0 to 6.43.0 in /web (QuantumNous#8105)

Bumps [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) from 6.27.0 to 6.43.0.
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/[email protected]/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-version: 6.43.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @tanstack/react-query-devtools in /web (QuantumNous#8104)

Bumps [@tanstack/react-query-devtools](https://github.com/TanStack/query/tree/HEAD/packages/react-query-devtools) from 5.101.2 to 5.105.0.
- [Release notes](https://github.com/TanStack/query/releases)
- [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query-devtools/CHANGELOG.md)
- [Commits](https://github.com/TanStack/query/commits/@tanstack/[email protected]/packages/react-query-devtools)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-version: 5.105.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump marked from 18.0.6 to 18.1.2 in /web (QuantumNous#8103)

Bumps [marked](https://github.com/markedjs/marked) from 18.0.6 to 18.1.2.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Commits](markedjs/marked@v18.0.6...v18.1.2)

---
updated-dependencies:
- dependency-name: marked
  dependency-version: 18.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @codemirror/language from 6.12.4 to 6.13.1 in /web (QuantumNous#8102)

Bumps [@codemirror/language](https://github.com/codemirror/language) from 6.12.4 to 6.13.1.
- [Changelog](https://github.com/codemirror/language/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/language/commits)

---
updated-dependencies:
- dependency-name: "@codemirror/language"
  dependency-version: 6.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(plugins): warn about task models a plugin cannot charge

A plugin change can leave a task model without a usable price: no price
is set, the price uses usage the plugin no longer provides, or the
plugin no longer offers the model. The gateway now lists these models.
The list follows the plugins currently serving, so a gateway update
that changes a built-in plugin shows up too.

- Uploading, installing from the marketplace, activating or enabling a
  plugin, or deleting its active version, lists the models it cannot
  charge in the upload dialog or in the notice after the action.
- Model pricing marks each of them "Price needs attention" with the
  reason, and a "Price status" filter lists them. A plugin model that
  was never priced now appears in the table too. The badge replaces
  "Task pricing not configured".
- The sidebar shows how many models need attention on System Settings,
  Billing & Payment and Model Pricing, for super administrators.
- GET /api/option/model_pricing/issues returns the list. It is root
  only; access tokens need the option:read scope.
- Prices kept for a switched-off plugin are not reported. They apply
  again when the plugin is switched back on.

* fix(deps): upgrade DOMPurify to 3.4.17 (QuantumNous#8116)

Upgrade the direct dependency and override to address GHSA-cg2g-xh64-v4q7.

Regenerate bun.lock with Bun and update the third-party license inventory.

* fix(profile): honor global sidebar visibility (QuantumNous#7429)

* fix(profile): honor global sidebar visibility

* fix(profile): wait for sidebar status

* feat(plugins): serve task plugins at the vendors' own paths and answer as the vendors do (QuantumNous#8117)

* feat(plugins): serve task plugins at the vendors' own paths

A vendor SDK or plain HTTP client can now point at the gateway and keep the
vendor's official paths. Every plugin route is also served under
/{plugin key}, and that address always runs that plugin.

- Plugins declare the vendor's official paths and the gateway adds the
  /{key} copy. Existing prefixed addresses keep working, including /ali
  for Alibaba Bailian.
- Several plugins may declare the same path. A submit runs on the plugin
  whose channel is selected; a query is answered by the plugin that owns
  the task.
- Under the gateway's own path segments (/api, /v1, /v1beta and so on)
  only built-in plugins get top-level paths; other plugins are served at
  their /{key} address. Plugin keys cannot reuse these segments.
- Jimeng uses the official Bearer API (/api/common/v3/submit_task_v2 and
  get_result_v2). The /jimeng/ route, which requests could not reach, is
  removed.
- MiniMax supports the official v1 query with ?task_id= and
  /v1/files/retrieve. The unimplemented GET /v1/files/{id} placeholder is
  removed. Vertex AI also accepts v1beta1 paths.
- Vidu routes accept Authorization: Token, and Google routes accept
  x-goog-api-key and ?key=. The key is redacted from logs.
- Gemini Veo results are read from generatedSamples, so their videos
  download again. Vertex AI videos returned inline are fetched again when
  downloaded.
- GET /v1/videos/{id} answers tasks created on xAI's routes in xAI's
  format, and :predictLongRunning requests reach the Veo plugin.
- Enabling, activating or promoting a plugin version is refused when it
  conflicts with another plugin, and force no longer skips that check.
- The plugin page lists each endpoint once, with a switch between the
  vendor path and the /{key} address. Legacy addresses are folded away.

* fix(logging): use the shared query credential masking for key=

The access log already masks credentials passed in the query string,
key included. A second redaction for the Gemini ?key= form rewrote it to
key=[REDACTED], so the log showed two masking styles and the masking
tests failed. Only the shared masking remains.

The Gemini native routes take ?key= out of the URL. With no query left,
the log fell back to the path gin recorded on arrival, which still
carried the key. The log now writes the path alone in that case, and the
plugin API document no longer says the key is logged as key=[REDACTED].

* feat(plugins): answer native plugin routes as the vendors do

A request sent to a vendor's own path now reaches the vendor as the client
wrote it, and the client gets the vendor's reply shape and status. The
gateway answers a native request with its own 400 only when it cannot tell
the model, cannot price the request, or cannot provide the feature; the
vendor checks everything else.

- New gateway rejections of that kind on native routes: callback_url on
  Ark, Kling, Vidu and MiniMax; Kling external_task_id and a body with
  model but no model_name; xAI storage_options, which was dropped
  silently; and for Jimeng, req_json on get_result_v2, a req_key the
  plugin cannot price, and frames other than 121 or 241. A value the
  plugin cannot read reserves the model's dearest tier, and settlement is
  unchanged.
- Native bodies are sent as the client wrote them. Plugins no longer fill
  in MiniMax-H3's duration, resolution and ratio or Vidu's
  movement_amplitude and images: null, drop Vidu's bgm: false, turn
  Jimeng's image and images into image_urls, or merge Ark's content.
  Kling requests no longer carry an added aspect_ratio 1:1, cfg_scale 0.5
  or model field; without a size Kling uses its own 16:9. DashScope
  requests go to the endpoint the client called.
- Replies keep each vendor's shapes and error codes. A native presenter
  may answer with the vendor's own status through a reply wrapper
  ({__status, __headers, __body}): xAI answers a pending video with 202,
  DashScope an unknown task with 200 UNKNOWN. A task the gateway failed
  shows as failed instead of still running. xAI's native query shows a
  video that failed but was charged as failed with xAI's usage, instead of
  done; billing is unchanged.
- A native client that asks the vendor for a stream (Seedream with
  stream: true, Wan interleaved output with X-DashScope-Sse: enable) gets
  the vendor's events as they arrive. Once an event has reached the
  client the task settles and is never refunded: a finished stream bills
  what was delivered, and a stream that stopped early bills the
  reservation and cuts the client's connection, so a downstream gateway
  keeps its reservation too. The client leaving does not cancel the
  upstream request, which TASK_PLUGIN_PROTOCOL_TIMEOUT_SECONDS bounds. A
  JSON reply from an older new-api upstream is still accepted.
- Routes that keep no result (retainResult: false) accept replies up to
  MAX_FILE_DOWNLOAD_MB, so b64_json images fit.
- Native decoders get the client's request headers, without gateway
  credentials, as ctx.requestHeaders.
- Native routes accept a channel's model aliases and case variants of
  model names, as the gateway's own formats do, also on routes that list
  their models.
- Kling lists kling-v2-5-turbo, kling-v2-6 and kling-v3, priced in units
  per mode, sound and voice; Kling retired kling-v1, kling-v1-6 and
  kling-v2-master on 2026-09-15. Vidu lists its current models, from
  viduq4-preview to vidu1.5.
- Clients of /v1/videos and the other gateway formats can no longer pass
  a native body through the field the plugins use for it internally.

* feat(plugins): add Kling 4.0 to the kling plugin

Kling 4.0 takes the model in the path and has its own request shape, so
the plugin serves POST /text-to-video/kling-4.0, /image-to-video/kling-4.0
and /omni-video/kling-4.0 as native routes, and answers GET
/tasks?task_ids= for their tasks. /v1/videos and the Responses API send
kling-4.0 as text-to-video or image-to-video, with size picking 720p or
1080p.

Billing follows Kling's price list: units per output second by
resolution, or, with an input video, twice the output, or input plus
output when the input is longer. Kling picks the length when the request
has none and only Kling knows how long an input video is, so the
reservation covers the longest of each. A task settles on the units Kling
deducted, or, when Kling took cash, on the durations it reports.

Kling 4.0 Flash has no published price yet and is left out.

* chore(plugins): bump the task plugins this branch changes

Each of these plugins now declares its vendor's own paths and answers
native requests as the vendor does; kling also adds Kling 4.0. That is
new behavior in every one of them, so each takes a minor version:
alibaba 1.5.0, doubao 1.4.0, google 1.2.0, hailuo 1.4.0, jimeng 1.2.0,
kling 1.2.0, vertex-ai 1.2.0, vidu 1.2.0 and xai 1.2.0.

* fix(plugins): keep Kling 4.0 durations in range and map every video size (QuantumNous#8118)

Kling 4.0 makes videos of 3 to 30 seconds. The plugin accepted 1 to 3600,
so a longer or shorter duration was reserved and then refunded when Kling
refused it. It is now refused before anything is reserved.

A /v1/videos size now gets the nearest of Kling's text-to-video aspect
ratios, 21:9 included for Kling 4.0, and Kling 4.0 takes 720p or 1080p by
the size's shorter side. Before, only four sizes were mapped: 720x720 was
reserved at 1080p and 1792x1024 was sent as 1:1. A size that is not
WIDTHxHEIGHT is refused.

* fix(plugins): load plugins that declare their own /{key} address (QuantumNous#8119)

Since the gateway also serves every route under /{key}, a plugin that
declared both a top-level route and the same route under its key failed
to load with "duplicate route". TypeSafe 1.2.0, already published,
declares POST /v1/systemone and POST /typesafe/v1/systemone and stopped
loading. The declared address now serves the copy, so the host no longer
adds it a second time.

* fix(plugins): prefer Kling's returned price (list_price) for Kling 4.0 cash billing (QuantumNous#8125)

* fix(plugins): charge relayed streams even when the reserve or task insert fails (QuantumNous#8121)

A native route relays the vendor's SSE events to the client as they arrive.
If the final reserve or the task insert then failed, the controller refunded
the whole reservation. The client kept the images and paid nothing.

Once the first event reaches the client, the controller no longer refunds.
A failed reserve no longer stops the submission. Settlement charges the
actual quota and may overdraw the token, as ordinary settlement does. A
failed task insert still settles the charge and writes the consume log.

* feat(plugins): generate video with Gemini Omni on Vertex AI channels (QuantumNous#8142)

* perf: read and edit request JSON and base64 with moego (QuantumNous#8148)

* perf: read and edit request JSON and base64 with moego

Switch gjson/sjson to moego/ojson and base64 on media, file and plugin
paths to moego/base64. Both keep the same results on valid input.

- Param overrides apply every edit to one ojson.Doc and write the body
  once, instead of copying the whole body for each edit.
- The video proxy and the audio check validate base64 without decoding
  it; plugin icons and inlined plugin files build data URLs directly.
- Login, password, OAuth and signature code keeps gjson and
  encoding/base64.

* perf: rewrite request fields without re-encoding the whole body

Removing disabled fields, the Responses WebSocket create event, AWS Mantle
and pass-through bodies, the OpenAI usage patch, alpha search, video result
redaction and image SSE events now edit the body with ojson.Doc instead of
decoding it into a map and encoding it again. Everything the gateway does
not touch keeps the client's member order, number spelling and characters.

- A key the client repeats is removed or rewritten in every copy, so an
  upstream that reads the last copy sees the same value the gateway routed
  and billed. A key that appears once is rewritten in place.
- Image responses and the video proxy read large values without copying
  them.

* perf: keep member order in param override merges and prune_objects

Merging an object (append/prepend) now replaces existing members where
they stand and appends new members, sorted by key, at the end. prune_objects
deletes the matching objects from the body in place instead of encoding
the pruned part, or the whole body, again. Everything else keeps the
client's member order, number spelling and characters.

* fix(xai): preserve token details in stream usage conversion (QuantumNous#6420)

xAIStreamHandler only copied prompt_tokens/total_tokens/completion_tokens
when converting the xAI stream usage, dropping prompt_tokens_details
(cached_tokens) and completion_tokens_details. As a result cached tokens
from streaming grok requests never reach the log, and cache pricing is
never applied — cached prompt tokens are billed at the full input rate.
Non-stream requests already keep these fields via xAIHandler.

Co-authored-by: Claude Fable 5 <[email protected]>

* feat(plugins): bill gemini omni by the tokens vertex reports (QuantumNous#8153)

* feat(relay): add opt-in HTTP/2 health checks (QuantumNous#8059)

* fix(twofa): restart the failure count after a lockout expires (QuantumNous#8172)

IncrementFailedAttempts kept the stale counter after a lockout window
expired, so the first wrong code after expiry computed MaxFailAttempts+1
and re-locked the account for the full LockoutDuration. When the stored
lockout has expired, start a new window at 1 and clear locked_until.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(gemini): add Argon fields and reasoning mappings (QuantumNous#8177)

* feat(channel): return created IDs with input mappings (QuantumNous#8164)

* feat(channel): return IDs of newly created channels

1. Preserve the success envelope and return created IDs for single and batch requests.

2. Keep generated IDs in the input slice and propagate panics after transaction rollback.

3. Document the response and cover duplicate credentials, chunk boundaries, empty batches, and rollback.

* feat(channel): map creation results to original inputs

Return input_index and channel_id for each accepted input while preserving existing IDs and credential parsing. Cover filtered empty inputs, duplicate keys, Vertex JSON, and multi-key channels in the API contract tests and OpenAPI examples.

* feat(vertex): add per-channel v1beta1 endpoint switch (QuantumNous#8179)

* feat(gemini): add Argon fields and reasoning mappings

* feat(vertex): add per-channel v1beta1 endpoint switch

* fix(gemini): bill embeddings from upstream usageMetadata (QuantumNous#8182)

* fix(auth): 校验 Redis 鉴权缓存完整性 (QuantumNous#8200)

* fix(auth): verify Redis authentication cache integrity

* fix(auth): repair auth cache hashes with unreadable fields

A token cache hash with a field that cannot be parsed, or with a stray
DeletedAt field, fell back to the database on every request and was
never rewritten. Repairs now read the stored signature on its own,
drop DeletedAt, and replace quota counters that are not integers in
both the token and user caches. Valid counters are still kept.

* feat: forward image complexity and markup for gpt-image-2.6 (QuantumNous#8208)

* fix(pricing): guide users through model pricing issues

* fix(pricing): review model price changes before saving

- Count pricing issues only for models an enabled channel serves, under
  its own name, a case variant or an alias. Stale saved prices still count.
- List built-in prices only when they are saved or a channel serves them.
- Keep deletions as drafts: a deleted row stays in the table with Undo
  until saved, and a row without a saved price has no delete action.
- Show old and new prices on changed rows and in the editor, and confirm
  every save with a per-model list of current and new prices.
- Count and confirm expression price edits; the form fields now take
  precedence over the option keys loaded with the page.
- On phones, give the tabs their own scrollable row and move secondary
  actions into a menu.

* fix(cache): 修复用户和令牌缓存的 Redis 跨槽错误 (QuantumNous#8218)

* fix(cache): colocate user and token auth keys in Redis slots

Use shared hash tags for cache hashes and authentication fences. Add regression coverage for matching tags and document coordinated rollout requirements.

AI-assisted implementation and tests.

* fix(cache): keep cache key names and tag fences with them

Renaming user:<id> and token:<hash> split quota counters and
invalidations between old and new nodes during a rolling upgrade.
Keep those names and tag the fence and version keys with the cache
key instead, so each script still touches a single slot.

---------

Co-authored-by: CaIon <[email protected]>

* fix: clarify session cache actions and expose per-rule clearing

* fix(vertex): cache service-account access tokens until they expire

The old cache stored the "not found" result of the first lookup and never
accepted the new token afterwards, so every request signed a new JWT and
exchanged it with Google.

Tokens are now kept per channel key slot until 5 minutes before the
expires_in Google returns (one hour when it is missing). Concurrent requests
share one exchange, a replaced service-account key gets a new token, and
failed exchanges are not cached.

* refactor(aws): remove the unused api_key HTTP request path

The relay never calls GetRequestURL before DoRequest, so the api_key branch
that built a /converse URL was never reached. API keys in the
"<api-key>|<region>" form already go through the AWS SDK with a bearer
token. Remove the dead branch and add a test for the SDK request.

* fix(plugins): serve uploaded plugins at top-level /v1 paths (QuantumNous#8241)

Since QuantumNous#8117 only built-in plugins were served at top-level paths whose
first segment the host uses (api, v1, v1beta, mj, pg, dashboard), so a
plugin installed from the marketplace lost addresses such as TypeSafe's
POST /v1/systemone and was only reachable under /{key}. Every plugin is
now served at its top-level paths. A path a host route answers first, or
one under another plugin's key, is still left to /{key}.

* fix(channel): restore a multi-key channel when a key is enabled after all keys failed

When request failures disabled every key of a multi-key channel, enabling
one key again left the channel auto-disabled. Enabling a key now restores
the channel in this case too. A later manual or tag disable is kept.

* fix(channel): keep a manual channel disable when a request fails

A request that failed after an admin disabled a channel changed it to
auto-disabled, so automatic channel tests could enable it again. A failure
no longer changes a manually disabled channel.

* fix(sqlite): keep the default SQLite settings when SQLITE_PATH is a plain path

A SQLITE_PATH without parameters replaced the WAL, busy timeout and
BEGIN IMMEDIATE settings, so concurrent writes could fail with
"database is locked". A plain path now gets the default parameters; a
value with its own parameters is used as given.

* feat(deepseek): 补全 Responses 工具历史缺失的 reasoning (QuantumNous#8162)

* fix: 补全 DeepSeek Responses 工具历史的 reasoning

* fix: 忽略 DeepSeek 官方主机名的大小写

* fix: 在参数覆盖后补全 DeepSeek Responses reasoning

* feat(plugins): add gemini omni 1.2 flash and send every input image to vertex (QuantumNous#8228)

* feat(plugins): add gemini omni 1.2 flash and send every input image to vertex

* fix(plugins): report why a gemini omni interaction failed

* chore(plugins): bump vertex-ai plugin to 1.3.0

* feat(channels): 高级自定义渠道增加 DeepSeek 搜索与抓取路径选项 (QuantumNous#8250)

* feat(channels): 添加网页搜索和网页抓取的路径选项

* feat(channel): 重命名工具标签为 DeepSeek Search 和 DeepSeek Fetch

新增测试文件,验证路径选项和标签的正确性

---------

Co-authored-by: longtsing <[email protected]>

* fix(oauth): persist inviter when creating OAuth users (QuantumNous#8247)

* fix(web): translate legal consent text on auth pages (QuantumNous#8254)

Wrap the terms footer sentence and link labels in t(), replace the
hardcoded ' and the ' in legal consent with t('and'), add the footer
keys to all locales, and fix the Vietnamese 'and' translation.

* feat: support HOST env to set the listen address (QuantumNous#8269)

* fix(deepseek): map developer role to system for chat completions (QuantumNous#8287)

DeepSeek Chat Completions rejects the developer role. Rewrite developer messages as system messages before sending them upstream; the Responses API accepts developer and is left unchanged.

* feat(payment): 易支付支持 RSA 签名方式 (QuantumNous#8291)

* feat(payment): 易支付支持 RSA 签名方式

支付设置新增「签名方式」,可在 MD5 与 RSA 之间二选一。默认 MD5,已配置 MD5 的站点升级后行为不变。

- RSA 模式用商户私钥签名下单请求,跳转 /api/pay/submit;充值和订阅回调用平台公钥验签,MD5 签名的回调会被拒绝
- 保存时校验密钥:RSA 生效期间商户私钥和平台公钥必须能解析,切换到 RSA 前要先保存两把密钥;读取设置时不返回密钥
- 设置页选择 MD5 时只显示商户密钥,选择 RSA 时显示商户私钥和平台公钥;七种语言补齐文案
- go-epay 升级到 v0.0.6

* refactor(payment): 易支付签名设置改用 payment_setting 注册配置

签名方式、商户私钥、平台公钥改为 PaymentSetting 的字段,键名为 payment_setting.epay_sign_type、payment_setting.epay_merchant_private_key、payment_setting.epay_platform_public_key,由配置管理器统一加载和保存,不再在 option.go 里逐项初始化和赋值。

- 保存校验移到 operation_setting.ValidateEpaySignOption,规则不变
- 读取设置时不返回以 private_key 结尾的配置项;平台公钥可以正常显示和修改

* fix(channels): 切换渠道时重置模型重定向同步状态 (QuantumNous#8304)

* fix(channels): reset model redirect sync state when switching channels

* fix(channels): rebase batch redirect sync on current mappings and add regression tests

* fix(web): sync risk confirmation text on composition end and blur

* perf: 升级 MoeForge moejs/moego,请求体按需流式读取 (QuantumNous#8311)

- moejs 迁到 github.com/MoeForge/moejs v0.1.0,Dockerfile、Electron 构建与发布流程的 PGO 路径同步更新;发布附带 THIRD-PARTY-LICENSES.md,并补充 moejs 附带的第三方声明。
- moego 升级到 v0.1.0-alpha.2:宿主 JSON 编解码经 common/kitutil 封装改用 moego/json,根模块和 relaykit 生产代码的 regexp 改用 moego/regexp。
- 内存中的请求体由校验器零拷贝解析;磁盘缓存的请求体经独立文件读取器解码,且只接受一个 JSON 值,尾随内容会被拒绝。
- 模型/分组提取与重复 model 键检测、渠道亲和 JSON 路径、任务协议 stream/background 标志、multipart 解析在磁盘模式下不再把整份请求体读进内存。图片透传直接转发已存储的请求体,并校验最终发往上游的 n。
- 出站请求体各自持有读取位置。此前透传重试共用存储游标,上一次尝试仍在发送时,下一次尝试可能发出残缺的请求体。收到响应头后不再提前关闭请求体,避免中断仍在发送的请求体。
- 表达式计费只在表达式使用 param() 时冻结请求体,其余情况不再读取并保留整份请求体。

* feat(plugins): add provider plugins, request plugins and a community marketplace (QuantumNous#8271)

* feat(plugins): add provider plugins, request plugins and a community marketplace

- Provider plugins turn an upstream vendor into a channel type: routes,
  protocol conversion, models, static keys, sign-in flows with token
  refresh, balance queries, per-channel config and a scheduled hook.
- Request plugins run on requests and replies (ingress, request,
  outbound, egress, reply, report), with instances by scope, model
  ranges, dry runs and per-log records. Built-ins: request filter,
  request redaction, parameter override, auto reasoning effort, image
  compression and content moderation. Sensitive words move into a
  request filter instance on first start.
- Node sync: a system_sync_topics table lets every node reload settings,
  channels, plugins and other data within seconds, and the system info
  page shows each node's state.
- Marketplace: a community source next to the official one, lookup by
  plugin code for official and community plugins, key rules for
  community plugins, install counts and takedown warnings.

* docs(plugins): name request protocols and host-only members in the plugin API

- Protocol names: ctx.format and samples use relaykit's protocol names.
  The spec lists the client paths and body of each name, so every host
  passes the same names to plugins.
- Host-specific members: channel, group, user, token, channelTypes,
  channelOther and utils.paramOverride exist only on new-api. The types
  mark them optional.
- Relay routes: the spec now writes out the route keys and the converters
  each incoming path accepts. The schema lists the converter names.

* feat(plugins): show recommended plugins from the official list too

The site now marks official plugins as recommended in its index. The
built-in official and community lists both get a Recommended group;
lists added by the administrator still cannot recommend plugins.

* feat(plugins): fall back to www.newapi.pro when www.newapi.ai does not answer

Plugin lists, plugin files and logos from www.newapi.ai are downloaded
from www.newapi.pro, the mainland China site, when newapi.ai gives no
answer within 10 seconds; the browser remembers this for a day. The
marketplace toolbar has a download site picker: Auto, or Mainland China
to always use www.newapi.pro. Saved source addresses stay on newapi.ai,
and every file is still checked against its sha256.

Community install counts go to newapi.ai first and to newapi.pro when
newapi.ai cannot be reached.

* fix(plugins): leaving the page does not switch the plugin site to www.newapi.pro

Reloading or leaving the marketplace cancels requests still running.
That was read as www.newapi.ai not answering, so the browser moved to
www.newapi.pro for a day although newapi.ai was reachable. Requests
cut off by leaving the page are no longer counted.

* feat(plugins): choose the plugin download site by hand

The marketplace no longer switches between plugin sites by itself. The
toolbar menu lists the main site www.newapi.ai, the backup site
www.newapi.pro and the other plugin lists; picking an entry is the only
thing that changes where plugins are downloaded from, and the main site
can always be picked again.

A browser that the earlier automatic switch had moved to www.newapi.pro
opens on the main site again. The download site, the source choice and
managing sources now share one menu in the list header.

* feat(plugins): show plugin usage guides and require README and changelog

Every marketplace plugin version now ships a usage guide, README.md, and a
changelog, CHANGELOG.md, next to plugin.js. The install dialog shows the
guide in the reader's language when a translation is listed, falls back to
English, and links to the source file. A guide or changelog that breaks the
format is reported with its file, line and rule instead of being shown.

The plugin API document describes both formats, the translations they may
list, and the checks the community marketplace runs before it accepts a
version: readme_missing, readme_invalid, changelog_missing and
changelog_invalid. Versions accepted before these checks are not checked
again.

* fix(plugins): address review findings on plugin parts, limits and access

- Only the root user reads request plugin instance configs; an admin who
  may bind instances to channels gets them without configs.
- Outbound hooks that grow the body are held to MAX_REQUEST_BODY_MB, as
  ingress hooks are, and answer 413 without a retry.
- An admin who cannot read plugin options keeps the balance and model
  list actions on plugin channels; the server answers whether they work.
- Reading the parts of a plugin source gives up when the source does not
  parse or code elsewhere refers to meta, as the meta preview does.

* fix(plugins): address review findings on request processing, documents and node sync

- PDF checks resolve indirect parameters and bound every value the parser
  allocates or loops on: predictor columns, object stream counts, nested
  object streams, cross-reference streams and ToUnicode ranges. Font and
  CMap work checks the deadline.
- A WebP frame must match its declared canvas, and keyword search stops at
  its match limit.
- Request processing treats a body as JSON whenever the gateway parses it
  as JSON, keeps Gemini reply parts in place, scopes instances by the
  settled auto group, hides channel header overrides from plugin param
  overrides, and captures replies only for report instances in scope.
- Request processing no longer follows the plugin master switch, which now
  covers plugin tasks and channels only.
- json.patch copies stop at MAX_REQUEST_BODY_MB, and provider prepareRequest
  effects past it answer 413.
- Image billing reads the count from the final upstream body, including the
  count members of SiliconFlow, Imagen and Replicate and the Imagen default.
- Automatic channel status changes no longer reload every node's channel
  cache. A credential refresh holds no channel lock while it waits on the
  vendor. A key that needs login is disabled and the request can retry.
- Balance requests must go to the channel host or allowedHosts, and provider
  stream events a plugin drops keep the stream alive.
- Node sync: OAuth provider writes bump inside their transaction, a failed
  startup load is retried, and each node is judged by its own topics.
- request-filter checks the text the old sensitive-word check did,
  request-redact and content-moderation handle large inputs, and
  image-compress lossless mode leaves JPEG and WebP alone.

* fix(plugins): address the second review on balances, egress and routes

- Channel other_info writes (status changes, balance queries and manual
  multi-key actions) only land while other_info is still the value read,
  and retry otherwise, so a write on one node no longer overwrites another
  node's balance or status reason. They write only their own columns.
- On the Responses path egress reads the body after the channel finalizes
  it, which is the body sent upstream.
- The Vertex AI plugin picks the region by the model the client asked for,
  as the built-in Vertex AI channel does.
- /request-processing and /security are reserved route namespaces, and a
  test checks that every console page is reserved.
- The plugin API docs say what egress reads on a provider plugin channel.

* feat(channels): run the balance update as a system task with progress

"Update all balances" now queues a channel_balance system task instead of
starting a goroutine guarded by an in-process flag. The task row holds the
progress (enabled channels queried of total), so any node can answer it,
and its active key keeps one run at a time across nodes. The
CHANNEL_UPDATE_FREQUENCY schedule becomes the same task's schedule, so
manual and scheduled runs no longer overlap.

GET /api/channel/update_balance answers with the task id, and with the
running one when a run is already queued. GET
/api/channel/update_balance/task/:task_id, under the same channel
permission, returns the status, progress and failure of balance update
tasks only. The channel list follows the task, reloads as more channels
are queried and once more at the end, and reports how the run ended.

* feat(system): sync nodes through system tasks and clean up task history

Node sync no longer needs its own table. A write to synced data adds a
pending sync_<topic> system task. Every node polls the newest task of each
topic it keeps every 3 s and reloads when that task is newer than the one
it applied. Custom OAuth providers still add their task inside the write
transaction, and lock the newest task of the topic first, so tasks commit
in id order. The master marks a sync task succeeded once every online node
that keeps the topic has applied it. Until then the task shows how many
nodes have applied it and why the others have not. The
system_sync_topics table is gone.

A composite (type, id) index answers the newest task of a type from the
index. The latest-per-type and earliest-pending queries now read ids first,
because MySQL 5.7 scanned the whole table for them.

A daily system_task_cleanup task deletes finished system tasks older than
system_task_setting.retention_days (default 30, at least 1), in batches.
It never deletes active tasks or the newest task of any type. The
retention is set under Operations > Log maintenance.

* chore(plugins): release vertex-ai 1.3.1 (QuantumNous#8313)

The Vertex AI plugin now reads the channel deployment region (QuantumNous#8271), which the published 1.3.0 does not. Give that code its own version so the built-in plugin matches the marketplace again.

* chore(web-deps): upgrade frontend dependencies (QuantumNous#6999)

Upgrade frontend dependencies, keeping the newer of this branch's targets and main's versions.

- Notable upgrades: motion 13, nanoid 6, jsdom 30, @base-ui/react 1.7, lucide-react 1.34, @rsbuild/core 2.2, recharts 3.10.1, shadcn 4.19, react 19.2.8, react-hook-form 7.86, @hookform/resolvers 5.9.
- Kept main's pins: dompurify 3.4.17 and katex 0.18.2.
- oxlint stays on 1.74: 1.79 splits the React Compiler rule and reports 158 new errors on existing components.
- sonner 2.0.8 replays active toasts to a newly mounted Toaster, so the marketplace install dialog test now dismisses toasts between cases.

* perf(password): improve password validation and feedback (QuantumNous#6928)

Show live password strength feedback that follows the account password policy (8–128 characters).

- Sign-up, change password, setup wizard and the admin user drawer show a strength meter, the length requirement and optional tips for a stronger password. Only the length blocks submission.
- Strength is rated mainly by length. Common passwords, one repeated character and straight runs such as 12345678 or qwertyui are marked as easy to guess, but only when they make up the whole password.
- The confirmation field says whether the passwords match, and a mismatch is shown only once.
- Password fields get a labelled show/hide button and link their hints for screen readers.
- Removed the unused 20-character limit and its translations.

* fix(i18n): name the super admin in the compliance lock notice (QuantumNous#6955)

The notification settings restructure from this branch is already on main (QuantumNous#7868). What remains is a wording fix in the payment compliance notice.

- zh, zh-TW, ja, ru, vi and fr now say "super administrator" in the notice that locks payment, redemption codes, subscription plans and invitation rewards, matching the rest of the UI.
- fr: replaced the stray Chinese word in "codes de兑换" with "codes d’échange".

* fix(web): align TanStack router devtools with the router core (QuantumNous#8320)

react-router-devtools 1.167.1 ships router-devtools-core 1.168.1, which calls interpolatePath() with one object, but it resolved the top-level router-core 1.171.34, where interpolatePath takes positional arguments. In dev mode the devtools panel threw "path.endsWith is not a function" on every route change.

- Bump @tanstack/react-router to ^1.170.41 and @tanstack/react-router-devtools to ^1.167.2.
- The router, the devtools and the router plugin now share one router-core, 1.171.34.
- Production builds do not include the devtools.

* fix(web): keep channel plugin settings inside the drawer (QuantumNous#8323)

A fieldset's default min-width is its content width, so a long line in
the plugin settings JSON editor widened the fieldset past the grid
column and pushed the plugin settings out of the channel drawer. Set
min-w-0 so the fieldset shrinks with its column and the editor scrolls
long lines itself.

* fix: 升级 moego 到 v0.1.0-alpha.3,修复无 AVX 的 x86-64 CPU 上的 SIGILL 崩溃 (QuantumNous#8322)

- rc.50 依赖的 moego v0.1.0-alpha.2 只按 AES-NI 选用 hashAES 内核,而该内核是 VEX 编码,需要 AVX。在有 AES-NI、没有 AVX 的 CPU(如 Celeron J4125)上,解析不少于 128 字节的请求 JSON 时进程因 SIGILL 退出,容器反复重启。
- alpha.3 在这类 CPU 上改用 SSE 编码的 AES 指令,结果与其他 CPU 相同。根模块和 relaykit 同步升级,THIRD-PARTY-LICENSES 中的版本号同步更新。

Fixes QuantumNous#8314

* feat: add doubao-seedream-5-5-261028 (QuantumNous#8324)

* docs(plugins): recommend a summary length that fits one marketplace line

The plugin site's marketplace list shows meta.description on one line
and cuts longer summaries off with an ellipsis. Measured on the live
list at desktop width, the summary column is 572 px at 14 px: 40 Chinese
characters fit and 41 do not, and real summaries of up to 80 columns
(CJK and full-width punctuation counting as two) all fit.

Add a "Plugin summary length" section to the API reference recommending
at most 80 columns per locale, with guidance on what to leave to the
usage guide, and point the manifest table and the Meta type at it.

* feat(plugins): 请求处理插件可声明作用范围,管理员确认一次即自动覆盖 (QuantumNous#8335)

* feat(plugins): let request plugins declare where they run

A request processing plugin can declare meta.scope: the models and
channel types it is made for. An administrator confirms that scope once
("Where the plugin suggests") and the instance then runs on every
matching request, new channels and models included. The instance runs
only where both the confirmed scope and the plugin's current scope hold,
so an update that narrows the scope applies at once and one that widens
it waits until an administrator confirms it again. The save API accepts
only the declared scope or the one saved before.

Instances placed by hand work as before.

* feat(plugins): let several plugins declare one channel type

A built-in channel type used to belong to one plugin: a second plugin
declaring it was rejected with "channelType N conflicts". Community
plugins for the same vendor (several Zhipu plugins, say) could not be
enabled together.

Now every plugin declaring a channel type is indexed for it. A channel
of the type serves each of them: its plugin extensions list their models,
and a request runs the plugin whose model it asks for, the first in key
order when several share the model. Model names that differ only in case
and protocol clashes still conflict.

* fix(plugins): match each request plugin scope on its own (QuantumNous#8341)

An instance with a plugin scope runs where both the confirmed scope and
the scope its plugin declares now hold the request. The two lists were
intersected word for word, so a confirmed gpt-4o and a declared
gpt-4o@effort:high shared nothing and the instance was skipped for
gpt-4o@effort:high, which both hold. Each scope now matches the request
on its own, modifiers included, and the instance runs when both match.

The docs also say that a task submitted before a scope change still
reports to the instances it stored, as for hand-placed instances.

* docs(github): slim agent issue and PR templates (QuantumNous#8344)

Move the out-of-scope list, filing gates, required facts, and writing
rules from the agent templates into .agents/github/CHECKS.md, so the
posted body keeps only Agent, Request summary, Summary, Evidence, and
Merge Danger or Blast Radius.

Replace the verbatim user request with a short summary, collapse the
Agent block to one line, and require a diagram in Summary when a PR
changes a flow, call chain, state, or layout.

* fix(relay): keep request-triggered errors from disabling channels (QuantumNous#8345)

Errors new-api raises itself because of the request no longer count
against the channel:

- A param override condition that meets a request value of another type
  (for example a string temperature in a numeric gt rule) now returns a
  400 invalid_request that is not retried, instead of
  channel:param_override_invalid, which was retried on every channel and
  could auto-disable each of them. Invalid rules that fail every request
  (non-numeric rule value, unsupported mode) stay channel errors.
- Image conversion failures use the shared convert-request-failed error,
  so they are no longer retried on other channels.
- Automatic channel disabling skips errors classified as local by the
  request policy log, so a local status or a disable keyword echoed from
  client input cannot disable a channel. Upstream responses that adaptors
  report as new-api errors, and local wrappers around an upstream error,
  keep their upstream classification. The logged health entry now uses
  the same decision.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: RedwindA <[email protected]>
Co-authored-by: feitianbubu <[email protected]>
Co-authored-by: Seefs <[email protected]>
Co-authored-by: undercat <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CaIon <[email protected]>
Co-authored-by: jimmyleocn <[email protected]>
Co-authored-by: JY <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Perfecto <[email protected]>
Co-authored-by: Alear03030 <[email protected]>
Co-authored-by: 101Harry <[email protected]>
Co-authored-by: Wang <[email protected]>
Co-authored-by: markcheney1 <[email protected]>
Co-authored-by: Longtsing <[email protected]>
Co-authored-by: longtsing <[email protected]>
Co-authored-by: Yorick <[email protected]>
Co-authored-by: Kc <[email protected]>
Co-authored-by: QuentinHsu <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: spizzkid23 <[email protected]>
yxsyzht-pixel added a commit to yxsyzht-pixel/new-api that referenced this pull request Nov 17, 2026
Upstream highlights:
- feat(plugins): provider plugins, request plugins and a community
  marketplace (QuantumNous#8271); request plugins declare their scope (QuantumNous#8335, QuantumNous#8341)
- fix(relay): request-triggered errors no longer disable channels (QuantumNous#8345)
- perf: MoeForge moejs/moego upgrade, request bodies read on demand
  (QuantumNous#8311); moego alpha.3 fixes SIGILL on CPUs without AVX (QuantumNous#8322)
- feat: doubao-seedream-5-5 (QuantumNous#8324); password validation feedback (QuantumNous#6928);
  frontend dependency upgrade (QuantumNous#6999) and smaller web fixes

Conflicts (18 files), each resolved by keeping both sides:
- api types, channel authz fields, startup tasks, relay adaptors, system
  task types and handlers, channel routes, backend i18n: the fork's
  Antigravity/Cursor/quota-recheck additions alongside upstream's plugin and
  balance additions.
- model/option.go: upstream's LoadOptionsFromDatabase with the fork's sync
  heartbeat log.
- relay/helper/valid_request.go: the fork's multipart TTS form path kept;
  the JSON path uses upstream's UnmarshalBodyReusableNoCopy.
- service/quota.go: the fork's callerGone kept; PreWssConsumeQuota takes
  upstream's (int, error) signature.
- service/relay_error.go: upstream's RecordRelayErrorLog, with the fork's
  request_bytes field read only from an already-stored body, since the log
  now also covers requests that never read theirs.
- channels-columns.tsx: upstream's balance cell; inference and Cursor
  channels keep opening their own dialog and get no balance hint.
- tests: upstream's rewritten billing request test; both reasoning suffix
  test sets.

Upstream tests adapted to fork behavior (a retry never returns to a channel
the request already tried; GetChannel/GetRandomSatisfiedChannel take the
tried set): model/channel_plugin_credential_test.go passes no tried
channels; in router/provider_plugin_relay_test.go the needs-login key is
replaced on the next request rather than the retry, and the mapped-429 retry
gets a second channel to go to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
therealemery added a commit to therealemery/new-api that referenced this pull request Nov 23, 2026
* Merge commit from fork

MaskSensitiveInfo trimmed trailing punctuation one byte at a time and
recounted the parentheses of the whole URL for each trailing ')'. Trim
the punctuation set, including ')', with strings.TrimRight; the trimmed
characters are still appended after the masked URL.

* Merge commit from fork

Upgrade @visactor/vchart and @visactor/react-vchart to 2.1.7. Since 2.1.6
the DOM tooltip renders the title as text (VisActor/VChart#4640).

* fix: unmount authenticated layout on sign-out to stop credential-less refetches (#8110)

* Merge commit from fork

Cap zstd windows at 8 MiB and the request body limit. Disable asynchronous decoding to avoid consuming bodies before downstream middleware accepts the request.

Port the complete zstd fix and regression tests from the related advisory PR without importing unrelated commits.

Validation in this repository with Go 1.26.10:
GOMAXPROCS=2 go test -p 2 ./middleware -count=1 -timeout=180s
GOMAXPROCS=1 go test -p 1 ./middleware -run '^TestDecompressRequestZstd' -count=1 -timeout=60s -v
go mod verify
All passed, including 14 decoding cases and early rejection without reading the body.

* fix(logger): keep gin access and recovery logs on the current log file after rotation (#8098)

The gin access logger and panic recovery captured gin.DefaultWriter and
gin.DefaultErrorWriter when the server was built. Since log rotation closes
the previous file, every [GIN] access line and [Recovery] stack after the
first rotation reached stdout/stderr only and never any log file.

Both middlewares now write through common.LogWriter / common.ErrorLogWriter,
which forward each write to the current gin writers under LogWriterMu, so
rotation can swap and close files without losing lines or leaking the old fd.
The server-wide recovery moves from main.go to middleware.PanicRecover so the
production wiring is covered by the regression test.

* fix: save Turnstile keys before enabling (#7960)

* chore(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6 (#8112)

Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Commits](https://github.com/go-jose/go-jose/compare/v4.1.4...v4.1.6)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-version: 4.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump undici in /electron (#8006)

Bumps  and [undici](https://github.com/nodejs/undici). These dependencies needed to be updated together.

Updates `undici` from 7.30.0 to 7.30.1
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.30.0...v7.30.1)

Updates `undici` from 6.29.0 to 6.29.1
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.30.0...v7.30.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.30.1
  dependency-type: indirect
- dependency-name: undici
  dependency-version: 6.29.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump electron from 41.10.6 to 42.11.16 in /electron (#8008)

Bumps [electron](https://github.com/electron/electron) from 41.10.6 to 42.11.16.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](https://github.com/electron/electron/compare/v41.10.6...v42.11.16)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 42.11.16
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump fast-uri from 3.1.7 to 3.1.9 in /electron (#8007)

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](https://github.com/fastify/fast-uri/compare/v3.1.7...v3.1.9)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump tailwind-merge from 3.6.0 to 3.7.0 in /web (#8106)

Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge/tree/HEAD/packages/tailwind-merge) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/commits/[email protected]/packages/tailwind-merge)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump knip from 6.27.0 to 6.43.0 in /web (#8105)

Bumps [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) from 6.27.0 to 6.43.0.
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/[email protected]/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-version: 6.43.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @tanstack/react-query-devtools in /web (#8104)

Bumps [@tanstack/react-query-devtools](https://github.com/TanStack/query/tree/HEAD/packages/react-query-devtools) from 5.101.2 to 5.105.0.
- [Release notes](https://github.com/TanStack/query/releases)
- [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query-devtools/CHANGELOG.md)
- [Commits](https://github.com/TanStack/query/commits/@tanstack/[email protected]/packages/react-query-devtools)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-version: 5.105.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump marked from 18.0.6 to 18.1.2 in /web (#8103)

Bumps [marked](https://github.com/markedjs/marked) from 18.0.6 to 18.1.2.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Commits](https://github.com/markedjs/marked/compare/v18.0.6...v18.1.2)

---
updated-dependencies:
- dependency-name: marked
  dependency-version: 18.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @codemirror/language from 6.12.4 to 6.13.1 in /web (#8102)

Bumps [@codemirror/language](https://github.com/codemirror/language) from 6.12.4 to 6.13.1.
- [Changelog](https://github.com/codemirror/language/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/language/commits)

---
updated-dependencies:
- dependency-name: "@codemirror/language"
  dependency-version: 6.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(plugins): warn about task models a plugin cannot charge

A plugin change can leave a task model without a usable price: no price
is set, the price uses usage the plugin no longer provides, or the
plugin no longer offers the model. The gateway now lists these models.
The list follows the plugins currently serving, so a gateway update
that changes a built-in plugin shows up too.

- Uploading, installing from the marketplace, activating or enabling a
  plugin, or deleting its active version, lists the models it cannot
  charge in the upload dialog or in the notice after the action.
- Model pricing marks each of them "Price needs attention" with the
  reason, and a "Price status" filter lists them. A plugin model that
  was never priced now appears in the table too. The badge replaces
  "Task pricing not configured".
- The sidebar shows how many models need attention on System Settings,
  Billing & Payment and Model Pricing, for super administrators.
- GET /api/option/model_pricing/issues returns the list. It is root
  only; access tokens need the option:read scope.
- Prices kept for a switched-off plugin are not reported. They apply
  again when the plugin is switched back on.

* fix(deps): upgrade DOMPurify to 3.4.17 (#8116)

Upgrade the direct dependency and override to address GHSA-cg2g-xh64-v4q7.

Regenerate bun.lock with Bun and update the third-party license inventory.

* fix(profile): honor global sidebar visibility (#7429)

* fix(profile): honor global sidebar visibility

* fix(profile): wait for sidebar status

* feat(plugins): serve task plugins at the vendors' own paths and answer as the vendors do (#8117)

* feat(plugins): serve task plugins at the vendors' own paths

A vendor SDK or plain HTTP client can now point at the gateway and keep the
vendor's official paths. Every plugin route is also served under
/{plugin key}, and that address always runs that plugin.

- Plugins declare the vendor's official paths and the gateway adds the
  /{key} copy. Existing prefixed addresses keep working, including /ali
  for Alibaba Bailian.
- Several plugins may declare the same path. A submit runs on the plugin
  whose channel is selected; a query is answered by the plugin that owns
  the task.
- Under the gateway's own path segments (/api, /v1, /v1beta and so on)
  only built-in plugins get top-level paths; other plugins are served at
  their /{key} address. Plugin keys cannot reuse these segments.
- Jimeng uses the official Bearer API (/api/common/v3/submit_task_v2 and
  get_result_v2). The /jimeng/ route, which requests could not reach, is
  removed.
- MiniMax supports the official v1 query with ?task_id= and
  /v1/files/retrieve. The unimplemented GET /v1/files/{id} placeholder is
  removed. Vertex AI also accepts v1beta1 paths.
- Vidu routes accept Authorization: Token, and Google routes accept
  x-goog-api-key and ?key=. The key is redacted from logs.
- Gemini Veo results are read from generatedSamples, so their videos
  download again. Vertex AI videos returned inline are fetched again when
  downloaded.
- GET /v1/videos/{id} answers tasks created on xAI's routes in xAI's
  format, and :predictLongRunning requests reach the Veo plugin.
- Enabling, activating or promoting a plugin version is refused when it
  conflicts with another plugin, and force no longer skips that check.
- The plugin page lists each endpoint once, with a switch between the
  vendor path and the /{key} address. Legacy addresses are folded away.

* fix(logging): use the shared query credential masking for key=

The access log already masks credentials passed in the query string,
key included. A second redaction for the Gemini ?key= form rewrote it to
key=[REDACTED], so the log showed two masking styles and the masking
tests failed. Only the shared masking remains.

The Gemini native routes take ?key= out of the URL. With no query left,
the log fell back to the path gin recorded on arrival, which still
carried the key. The log now writes the path alone in that case, and the
plugin API document no longer says the key is logged as key=[REDACTED].

* feat(plugins): answer native plugin routes as the vendors do

A request sent to a vendor's own path now reaches the vendor as the client
wrote it, and the client gets the vendor's reply shape and status. The
gateway answers a native request with its own 400 only when it cannot tell
the model, cannot price the request, or cannot provide the feature; the
vendor checks everything else.

- New gateway rejections of that kind on native routes: callback_url on
  Ark, Kling, Vidu and MiniMax; Kling external_task_id and a body with
  model but no model_name; xAI storage_options, which was dropped
  silently; and for Jimeng, req_json on get_result_v2, a req_key the
  plugin cannot price, and frames other than 121 or 241. A value the
  plugin cannot read reserves the model's dearest tier, and settlement is
  unchanged.
- Native bodies are sent as the client wrote them. Plugins no longer fill
  in MiniMax-H3's duration, resolution and ratio or Vidu's
  movement_amplitude and images: null, drop Vidu's bgm: false, turn
  Jimeng's image and images into image_urls, or merge Ark's content.
  Kling requests no longer carry an added aspect_ratio 1:1, cfg_scale 0.5
  or model field; without a size Kling uses its own 16:9. DashScope
  requests go to the endpoint the client called.
- Replies keep each vendor's shapes and error codes. A native presenter
  may answer with the vendor's own status through a reply wrapper
  ({__status, __headers, __body}): xAI answers a pending video with 202,
  DashScope an unknown task with 200 UNKNOWN. A task the gateway failed
  shows as failed instead of still running. xAI's native query shows a
  video that failed but was charged as failed with xAI's usage, instead of
  done; billing is unchanged.
- A native client that asks the vendor for a stream (Seedream with
  stream: true, Wan interleaved output with X-DashScope-Sse: enable) gets
  the vendor's events as they arrive. Once an event has reached the
  client the task settles and is never refunded: a finished stream bills
  what was delivered, and a stream that stopped early bills the
  reservation and cuts the client's connection, so a downstream gateway
  keeps its reservation too. The client leaving does not cancel the
  upstream request, which TASK_PLUGIN_PROTOCOL_TIMEOUT_SECONDS bounds. A
  JSON reply from an older new-api upstream is still accepted.
- Routes that keep no result (retainResult: false) accept replies up to
  MAX_FILE_DOWNLOAD_MB, so b64_json images fit.
- Native decoders get the client's request headers, without gateway
  credentials, as ctx.requestHeaders.
- Native routes accept a channel's model aliases and case variants of
  model names, as the gateway's own formats do, also on routes that list
  their models.
- Kling lists kling-v2-5-turbo, kling-v2-6 and kling-v3, priced in units
  per mode, sound and voice; Kling retired kling-v1, kling-v1-6 and
  kling-v2-master on 2026-09-15. Vidu lists its current models, from
  viduq4-preview to vidu1.5.
- Clients of /v1/videos and the other gateway formats can no longer pass
  a native body through the field the plugins use for it internally.

* feat(plugins): add Kling 4.0 to the kling plugin

Kling 4.0 takes the model in the path and has its own request shape, so
the plugin serves POST /text-to-video/kling-4.0, /image-to-video/kling-4.0
and /omni-video/kling-4.0 as native routes, and answers GET
/tasks?task_ids= for their tasks. /v1/videos and the Responses API send
kling-4.0 as text-to-video or image-to-video, with size picking 720p or
1080p.

Billing follows Kling's price list: units per output second by
resolution, or, with an input video, twice the output, or input plus
output when the input is longer. Kling picks the length when the request
has none and only Kling knows how long an input video is, so the
reservation covers the longest of each. A task settles on the units Kling
deducted, or, when Kling took cash, on the durations it reports.

Kling 4.0 Flash has no published price yet and is left out.

* chore(plugins): bump the task plugins this branch changes

Each of these plugins now declares its vendor's own paths and answers
native requests as the vendor does; kling also adds Kling 4.0. That is
new behavior in every one of them, so each takes a minor version:
alibaba 1.5.0, doubao 1.4.0, google 1.2.0, hailuo 1.4.0, jimeng 1.2.0,
kling 1.2.0, vertex-ai 1.2.0, vidu 1.2.0 and xai 1.2.0.

* fix(plugins): keep Kling 4.0 durations in range and map every video size (#8118)

Kling 4.0 makes videos of 3 to 30 seconds. The plugin accepted 1 to 3600,
so a longer or shorter duration was reserved and then refunded when Kling
refused it. It is now refused before anything is reserved.

A /v1/videos size now gets the nearest of Kling's text-to-video aspect
ratios, 21:9 included for Kling 4.0, and Kling 4.0 takes 720p or 1080p by
the size's shorter side. Before, only four sizes were mapped: 720x720 was
reserved at 1080p and 1792x1024 was sent as 1:1. A size that is not
WIDTHxHEIGHT is refused.

* fix(plugins): load plugins that declare their own /{key} address (#8119)

Since the gateway also serves every route under /{key}, a plugin that
declared both a top-level route and the same route under its key failed
to load with "duplicate route". TypeSafe 1.2.0, already published,
declares POST /v1/systemone and POST /typesafe/v1/systemone and stopped
loading. The declared address now serves the copy, so the host no longer
adds it a second time.

* fix(plugins): prefer Kling's returned price (list_price) for Kling 4.0 cash billing (#8125)

* fix(plugins): charge relayed streams even when the reserve or task insert fails (#8121)

A native route relays the vendor's SSE events to the client as they arrive.
If the final reserve or the task insert then failed, the controller refunded
the whole reservation. The client kept the images and paid nothing.

Once the first event reaches the client, the controller no longer refunds.
A failed reserve no longer stops the submission. Settlement charges the
actual quota and may overdraw the token, as ordinary settlement does. A
failed task insert still settles the charge and writes the consume log.

* feat(plugins): generate video with Gemini Omni on Vertex AI channels (#8142)

* perf: read and edit request JSON and base64 with moego (#8148)

* perf: read and edit request JSON and base64 with moego

Switch gjson/sjson to moego/ojson and base64 on media, file and plugin
paths to moego/base64. Both keep the same results on valid input.

- Param overrides apply every edit to one ojson.Doc and write the body
  once, instead of copying the whole body for each edit.
- The video proxy and the audio check validate base64 without decoding
  it; plugin icons and inlined plugin files build data URLs directly.
- Login, password, OAuth and signature code keeps gjson and
  encoding/base64.

* perf: rewrite request fields without re-encoding the whole body

Removing disabled fields, the Responses WebSocket create event, AWS Mantle
and pass-through bodies, the OpenAI usage patch, alpha search, video result
redaction and image SSE events now edit the body with ojson.Doc instead of
decoding it into a map and encoding it again. Everything the gateway does
not touch keeps the client's member order, number spelling and characters.

- A key the client repeats is removed or rewritten in every copy, so an
  upstream that reads the last copy sees the same value the gateway routed
  and billed. A key that appears once is rewritten in place.
- Image responses and the video proxy read large values without copying
  them.

* perf: keep member order in param override merges and prune_objects

Merging an object (append/prepend) now replaces existing members where
they stand and appends new members, sorted by key, at the end. prune_objects
deletes the matching objects from the body in place instead of encoding
the pruned part, or the whole body, again. Everything else keeps the
client's member order, number spelling and characters.

* fix(xai): preserve token details in stream usage conversion (#6420)

xAIStreamHandler only copied prompt_tokens/total_tokens/completion_tokens
when converting the xAI stream usage, dropping prompt_tokens_details
(cached_tokens) and completion_tokens_details. As a result cached tokens
from streaming grok requests never reach the log, and cache pricing is
never applied — cached prompt tokens are billed at the full input rate.
Non-stream requests already keep these fields via xAIHandler.

Co-authored-by: Claude Fable 5 <[email protected]>

* feat(plugins): bill gemini omni by the tokens vertex reports (#8153)

* feat(relay): add opt-in HTTP/2 health checks (#8059)

* fix(twofa): restart the failure count after a lockout expires (#8172)

IncrementFailedAttempts kept the stale counter after a lockout window
expired, so the first wrong code after expiry computed MaxFailAttempts+1
and re-locked the account for the full LockoutDuration. When the stored
lockout has expired, start a new window at 1 and clear locked_until.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(gemini): add Argon fields and reasoning mappings (#8177)

* feat(channel): return created IDs with input mappings (#8164)

* feat(channel): return IDs of newly created channels

1. Preserve the success envelope and return created IDs for single and batch requests.

2. Keep generated IDs in the input slice and propagate panics after transaction rollback.

3. Document the response and cover duplicate credentials, chunk boundaries, empty batches, and rollback.

* feat(channel): map creation results to original inputs

Return input_index and channel_id for each accepted input while preserving existing IDs and credential parsing. Cover filtered empty inputs, duplicate keys, Vertex JSON, and multi-key channels in the API contract tests and OpenAPI examples.

* feat(vertex): add per-channel v1beta1 endpoint switch (#8179)

* feat(gemini): add Argon fields and reasoning mappings

* feat(vertex): add per-channel v1beta1 endpoint switch

* fix(gemini): bill embeddings from upstream usageMetadata (#8182)

* fix(auth): 校验 Redis 鉴权缓存完整性 (#8200)

* fix(auth): verify Redis authentication cache integrity

* fix(auth): repair auth cache hashes with unreadable fields

A token cache hash with a field that cannot be parsed, or with a stray
DeletedAt field, fell back to the database on every request and was
never rewritten. Repairs now read the stored signature on its own,
drop DeletedAt, and replace quota counters that are not integers in
both the token and user caches. Valid counters are still kept.

* feat: forward image complexity and markup for gpt-image-2.6 (#8208)

* fix(pricing): guide users through model pricing issues

* fix(pricing): review model price changes before saving

- Count pricing issues only for models an enabled channel serves, under
  its own name, a case variant or an alias. Stale saved prices still count.
- List built-in prices only when they are saved or a channel serves them.
- Keep deletions as drafts: a deleted row stays in the table with Undo
  until saved, and a row without a saved price has no delete action.
- Show old and new prices on changed rows and in the editor, and confirm
  every save with a per-model list of current and new prices.
- Count and confirm expression price edits; the form fields now take
  precedence over the option keys loaded with the page.
- On phones, give the tabs their own scrollable row and move secondary
  actions into a menu.

* fix(cache): 修复用户和令牌缓存的 Redis 跨槽错误 (#8218)

* fix(cache): colocate user and token auth keys in Redis slots

Use shared hash tags for cache hashes and authentication fences. Add regression coverage for matching tags and document coordinated rollout requirements.

AI-assisted implementation and tests.

* fix(cache): keep cache key names and tag fences with them

Renaming user:<id> and token:<hash> split quota counters and
invalidations between old and new nodes during a rolling upgrade.
Keep those names and tag the fence and version keys with the cache
key instead, so each script still touches a single slot.

---------

Co-authored-by: CaIon <[email protected]>

* fix: clarify session cache actions and expose per-rule clearing

* fix(vertex): cache service-account access tokens until they expire

The old cache stored the "not found" result of the first lookup and never
accepted the new token afterwards, so every request signed a new JWT and
exchanged it with Google.

Tokens are now kept per channel key slot until 5 minutes before the
expires_in Google returns (one hour when it is missing). Concurrent requests
share one exchange, a replaced service-account key gets a new token, and
failed exchanges are not cached.

* refactor(aws): remove the unused api_key HTTP request path

The relay never calls GetRequestURL before DoRequest, so the api_key branch
that built a /converse URL was never reached. API keys in the
"<api-key>|<region>" form already go through the AWS SDK with a bearer
token. Remove the dead branch and add a test for the SDK request.

* fix(plugins): serve uploaded plugins at top-level /v1 paths (#8241)

Since #8117 only built-in plugins were served at top-level paths whose
first segment the host uses (api, v1, v1beta, mj, pg, dashboard), so a
plugin installed from the marketplace lost addresses such as TypeSafe's
POST /v1/systemone and was only reachable under /{key}. Every plugin is
now served at its top-level paths. A path a host route answers first, or
one under another plugin's key, is still left to /{key}.

* fix(channel): restore a multi-key channel when a key is enabled after all keys failed

When request failures disabled every key of a multi-key channel, enabling
one key again left the channel auto-disabled. Enabling a key now restores
the channel in this case too. A later manual or tag disable is kept.

* fix(channel): keep a manual channel disable when a request fails

A request that failed after an admin disabled a channel changed it to
auto-disabled, so automatic channel tests could enable it again. A failure
no longer changes a manually disabled channel.

* fix(sqlite): keep the default SQLite settings when SQLITE_PATH is a plain path

A SQLITE_PATH without parameters replaced the WAL, busy timeout and
BEGIN IMMEDIATE settings, so concurrent writes could fail with
"database is locked". A plain path now gets the default parameters; a
value with its own parameters is used as given.

* feat(deepseek): 补全 Responses 工具历史缺失的 reasoning (#8162)

* fix: 补全 DeepSeek Responses 工具历史的 reasoning

* fix: 忽略 DeepSeek 官方主机名的大小写

* fix: 在参数覆盖后补全 DeepSeek Responses reasoning

* feat(plugins): add gemini omni 1.2 flash and send every input image to vertex (#8228)

* feat(plugins): add gemini omni 1.2 flash and send every input image to vertex

* fix(plugins): report why a gemini omni interaction failed

* chore(plugins): bump vertex-ai plugin to 1.3.0

* feat(channels): 高级自定义渠道增加 DeepSeek 搜索与抓取路径选项 (#8250)

* feat(channels): 添加网页搜索和网页抓取的路径选项

* feat(channel): 重命名工具标签为 DeepSeek Search 和 DeepSeek Fetch

新增测试文件,验证路径选项和标签的正确性

---------

Co-authored-by: longtsing <[email protected]>

* fix(oauth): persist inviter when creating OAuth users (#8247)

* fix(web): translate legal consent text on auth pages (#8254)

Wrap the terms footer sentence and link labels in t(), replace the
hardcoded ' and the ' in legal consent with t('and'), add the footer
keys to all locales, and fix the Vietnamese 'and' translation.

* feat: support HOST env to set the listen address (#8269)

* fix(deepseek): map developer role to system for chat completions (#8287)

DeepSeek Chat Completions rejects the developer role. Rewrite developer messages as system messages before sending them upstream; the Responses API accepts developer and is left unchanged.

* feat(payment): 易支付支持 RSA 签名方式 (#8291)

* feat(payment): 易支付支持 RSA 签名方式

支付设置新增「签名方式」,可在 MD5 与 RSA 之间二选一。默认 MD5,已配置 MD5 的站点升级后行为不变。

- RSA 模式用商户私钥签名下单请求,跳转 /api/pay/submit;充值和订阅回调用平台公钥验签,MD5 签名的回调会被拒绝
- 保存时校验密钥:RSA 生效期间商户私钥和平台公钥必须能解析,切换到 RSA 前要先保存两把密钥;读取设置时不返回密钥
- 设置页选择 MD5 时只显示商户密钥,选择 RSA 时显示商户私钥和平台公钥;七种语言补齐文案
- go-epay 升级到 v0.0.6

* refactor(payment): 易支付签名设置改用 payment_setting 注册配置

签名方式、商户私钥、平台公钥改为 PaymentSetting 的字段,键名为 payment_setting.epay_sign_type、payment_setting.epay_merchant_private_key、payment_setting.epay_platform_public_key,由配置管理器统一加载和保存,不再在 option.go 里逐项初始化和赋值。

- 保存校验移到 operation_setting.ValidateEpaySignOption,规则不变
- 读取设置时不返回以 private_key 结尾的配置项;平台公钥可以正常显示和修改

* fix(channels): 切换渠道时重置模型重定向同步状态 (#8304)

* fix(channels): reset model redirect sync state when switching channels

* fix(channels): rebase batch redirect sync on current mappings and add regression tests

* fix(web): sync risk confirmation text on composition end and blur

* perf: 升级 MoeForge moejs/moego,请求体按需流式读取 (#8311)

- moejs 迁到 github.com/MoeForge/moejs v0.1.0,Dockerfile、Electron 构建与发布流程的 PGO 路径同步更新;发布附带 THIRD-PARTY-LICENSES.md,并补充 moejs 附带的第三方声明。
- moego 升级到 v0.1.0-alpha.2:宿主 JSON 编解码经 common/kitutil 封装改用 moego/json,根模块和 relaykit 生产代码的 regexp 改用 moego/regexp。
- 内存中的请求体由校验器零拷贝解析;磁盘缓存的请求体经独立文件读取器解码,且只接受一个 JSON 值,尾随内容会被拒绝。
- 模型/分组提取与重复 model 键检测、渠道亲和 JSON 路径、任务协议 stream/background 标志、multipart 解析在磁盘模式下不再把整份请求体读进内存。图片透传直接转发已存储的请求体,并校验最终发往上游的 n。
- 出站请求体各自持有读取位置。此前透传重试共用存储游标,上一次尝试仍在发送时,下一次尝试可能发出残缺的请求体。收到响应头后不再提前关闭请求体,避免中断仍在发送的请求体。
- 表达式计费只在表达式使用 param() 时冻结请求体,其余情况不再读取并保留整份请求体。

* feat(plugins): add provider plugins, request plugins and a community marketplace (#8271)

* feat(plugins): add provider plugins, request plugins and a community marketplace

- Provider plugins turn an upstream vendor into a channel type: routes,
  protocol conversion, models, static keys, sign-in flows with token
  refresh, balance queries, per-channel config and a scheduled hook.
- Request plugins run on requests and replies (ingress, request,
  outbound, egress, reply, report), with instances by scope, model
  ranges, dry runs and per-log records. Built-ins: request filter,
  request redaction, parameter override, auto reasoning effort, image
  compression and content moderation. Sensitive words move into a
  request filter instance on first start.
- Node sync: a system_sync_topics table lets every node reload settings,
  channels, plugins and other data within seconds, and the system info
  page shows each node's state.
- Marketplace: a community source next to the official one, lookup by
  plugin code for official and community plugins, key rules for
  community plugins, install counts and takedown warnings.

* docs(plugins): name request protocols and host-only members in the plugin API

- Protocol names: ctx.format and samples use relaykit's protocol names.
  The spec lists the client paths and body of each name, so every host
  passes the same names to plugins.
- Host-specific members: channel, group, user, token, channelTypes,
  channelOther and utils.paramOverride exist only on new-api. The types
  mark them optional.
- Relay routes: the spec now writes out the route keys and the converters
  each incoming path accepts. The schema lists the converter names.

* feat(plugins): show recommended plugins from the official list too

The site now marks official plugins as recommended in its index. The
built-in official and community lists both get a Recommended group;
lists added by the administrator still cannot recommend plugins.

* feat(plugins): fall back to www.newapi.pro when www.newapi.ai does not answer

Plugin lists, plugin files and logos from www.newapi.ai are downloaded
from www.newapi.pro, the mainland China site, when newapi.ai gives no
answer within 10 seconds; the browser remembers this for a day. The
marketplace toolbar has a download site picker: Auto, or Mainland China
to always use www.newapi.pro. Saved source addresses stay on newapi.ai,
and every file is still checked against its sha256.

Community install counts go to newapi.ai first and to newapi.pro when
newapi.ai cannot be reached.

* fix(plugins): leaving the page does not switch the plugin site to www.newapi.pro

Reloading or leaving the marketplace cancels requests still running.
That was read as www.newapi.ai not answering, so the browser moved to
www.newapi.pro for a day although newapi.ai was reachable. Requests
cut off by leaving the page are no longer counted.

* feat(plugins): choose the plugin download site by hand

The marketplace no longer switches between plugin sites by itself. The
toolbar menu lists the main site www.newapi.ai, the backup site
www.newapi.pro and the other plugin lists; picking an entry is the only
thing that changes where plugins are downloaded from, and the main site
can always be picked again.

A browser that the earlier automatic switch had moved to www.newapi.pro
opens on the main site again. The download site, the source choice and
managing sources now share one menu in the list header.

* feat(plugins): show plugin usage guides and require README and changelog

Every marketplace plugin version now ships a usage guide, README.md, and a
changelog, CHANGELOG.md, next to plugin.js. The install dialog shows the
guide in the reader's language when a translation is listed, falls back to
English, and links to the source file. A guide or changelog that breaks the
format is reported with its file, line and rule instead of being shown.

The plugin API document describes both formats, the translations they may
list, and the checks the community marketplace runs before it accepts a
version: readme_missing, readme_invalid, changelog_missing and
changelog_invalid. Versions accepted before these checks are not checked
again.

* fix(plugins): address review findings on plugin parts, limits and access

- Only the root user reads request plugin instance configs; an admin who
  may bind instances to channels gets them without configs.
- Outbound hooks that grow the body are held to MAX_REQUEST_BODY_MB, as
  ingress hooks are, and answer 413 without a retry.
- An admin who cannot read plugin options keeps the balance and model
  list actions on plugin channels; the server answers whether they work.
- Reading the parts of a plugin source gives up when the source does not
  parse or code elsewhere refers to meta, as the meta preview does.

* fix(plugins): address review findings on request processing, documents and node sync

- PDF checks resolve indirect parameters and bound every value the parser
  allocates or loops on: predictor columns, object stream counts, nested
  object streams, cross-reference streams and ToUnicode ranges. Font and
  CMap work checks the deadline.
- A WebP frame must match its declared canvas, and keyword search stops at
  its match limit.
- Request processing treats a body as JSON whenever the gateway parses it
  as JSON, keeps Gemini reply parts in place, scopes instances by the
  settled auto group, hides channel header overrides from plugin param
  overrides, and captures replies only for report instances in scope.
- Request processing no longer follows the plugin master switch, which now
  covers plugin tasks and channels only.
- json.patch copies stop at MAX_REQUEST_BODY_MB, and provider prepareRequest
  effects past it answer 413.
- Image billing reads the count from the final upstream body, including the
  count members of SiliconFlow, Imagen and Replicate and the Imagen default.
- Automatic channel status changes no longer reload every node's channel
  cache. A credential refresh holds no channel lock while it waits on the
  vendor. A key that needs login is disabled and the request can retry.
- Balance requests must go to the channel host or allowedHosts, and provider
  stream events a plugin drops keep the stream alive.
- Node sync: OAuth provider writes bump inside their transaction, a failed
  startup load is retried, and each node is judged by its own topics.
- request-filter checks the text the old sensitive-word check did,
  request-redact and content-moderation handle large inputs, and
  image-compress lossless mode leaves JPEG and WebP alone.

* fix(plugins): address the second review on balances, egress and routes

- Channel other_info writes (status changes, balance queries and manual
  multi-key actions) only land while other_info is still the value read,
  and retry otherwise, so a write on one node no longer overwrites another
  node's balance or status reason. They write only their own columns.
- On the Responses path egress reads the body after the channel finalizes
  it, which is the body sent upstream.
- The Vertex AI plugin picks the region by the model the client asked for,
  as the built-in Vertex AI channel does.
- /request-processing and /security are reserved route namespaces, and a
  test checks that every console page is reserved.
- The plugin API docs say what egress reads on a provider plugin channel.

* feat(channels): run the balance update as a system task with progress

"Update all balances" now queues a channel_balance system task instead of
starting a goroutine guarded by an in-process flag. The task row holds the
progress (enabled channels queried of total), so any node can answer it,
and its active key keeps one run at a time across nodes. The
CHANNEL_UPDATE_FREQUENCY schedule becomes the same task's schedule, so
manual and scheduled runs no longer overlap.

GET /api/channel/update_balance answers with the task id, and with the
running one when a run is already queued. GET
/api/channel/update_balance/task/:task_id, under the same channel
permission, returns the status, progress and failure of balance update
tasks only. The channel list follows the task, reloads as more channels
are queried and once more at the end, and reports how the run ended.

* feat(system): sync nodes through system tasks and clean up task history

Node sync no longer needs its own table. A write to synced data adds a
pending sync_<topic> system task. Every node polls the newest task of each
topic it keeps every 3 s and reloads when that task is newer than the one
it applied. Custom OAuth providers still add their task inside the write
transaction, and lock the newest task of the topic first, so tasks commit
in id order. The master marks a sync task succeeded once every online node
that keeps the topic has applied it. Until then the task shows how many
nodes have applied it and why the others have not. The
system_sync_topics table is gone.

A composite (type, id) index answers the newest task of a type from the
index. The latest-per-type and earliest-pending queries now read ids first,
because MySQL 5.7 scanned the whole table for them.

A daily system_task_cleanup task deletes finished system tasks older than
system_task_setting.retention_days (default 30, at least 1), in batches.
It never deletes active tasks or the newest task of any type. The
retention is set under Operations > Log maintenance.

* chore(plugins): release vertex-ai 1.3.1 (#8313)

The Vertex AI plugin now reads the channel deployment region (#8271), which the published 1.3.0 does not. Give that code its own version so the built-in plugin matches the marketplace again.

* chore(web-deps): upgrade frontend dependencies (#6999)

Upgrade frontend dependencies, keeping the newer of this branch's targets and main's versions.

- Notable upgrades: motion 13, nanoid 6, jsdom 30, @base-ui/react 1.7, lucide-react 1.34, @rsbuild/core 2.2, recharts 3.10.1, shadcn 4.19, react 19.2.8, react-hook-form 7.86, @hookform/resolvers 5.9.
- Kept main's pins: dompurify 3.4.17 and katex 0.18.2.
- oxlint stays on 1.74: 1.79 splits the React Compiler rule and reports 158 new errors on existing components.
- sonner 2.0.8 replays active toasts to a newly mounted Toaster, so the marketplace install dialog test now dismisses toasts between cases.

* perf(password): improve password validation and feedback (#6928)

Show live password strength feedback that follows the account password policy (8–128 characters).

- Sign-up, change password, setup wizard and the admin user drawer show a strength meter, the length requirement and optional tips for a stronger password. Only the length blocks submission.
- Strength is rated mainly by length. Common passwords, one repeated character and straight runs such as 12345678 or qwertyui are marked as easy to guess, but only when they make up the whole password.
- The confirmation field says whether the passwords match, and a mismatch is shown only once.
- Password fields get a labelled show/hide button and link their hints for screen readers.
- Removed the unused 20-character limit and its translations.

* fix(i18n): name the super admin in the compliance lock notice (#6955)

The notification settings restructure from this branch is already on main (#7868). What remains is a wording fix in the payment compliance notice.

- zh, zh-TW, ja, ru, vi and fr now say "super administrator" in the notice that locks payment, redemption codes, subscription plans and invitation rewards, matching the rest of the UI.
- fr: replaced the stray Chinese word in "codes de兑换" with "codes d’échange".

* fix(web): align TanStack router devtools with the router core (#8320)

react-router-devtools 1.167.1 ships router-devtools-core 1.168.1, which calls interpolatePath() with one object, but it resolved the top-level router-core 1.171.34, where interpolatePath takes positional arguments. In dev mode the devtools panel threw "path.endsWith is not a function" on every route change.

- Bump @tanstack/react-router to ^1.170.41 and @tanstack/react-router-devtools to ^1.167.2.
- The router, the devtools and the router plugin now share one router-core, 1.171.34.
- Production builds do not include the devtools.

* fix(web): keep channel plugin settings inside the drawer (#8323)

A fieldset's default min-width is its content width, so a long line in
the plugin settings JSON editor widened the fieldset past the grid
column and pushed the plugin settings out of the channel drawer. Set
min-w-0 so the fieldset shrinks with its column and the editor scrolls
long lines itself.

* fix: 升级 moego 到 v0.1.0-alpha.3,修复无 AVX 的 x86-64 CPU 上的 SIGILL 崩溃 (#8322)

- rc.50 依赖的 moego v0.1.0-alpha.2 只按 AES-NI 选用 hashAES 内核,而该内核是 VEX 编码,需要 AVX。在有 AES-NI、没有 AVX 的 CPU(如 Celeron J4125)上,解析不少于 128 字节的请求 JSON 时进程因 SIGILL 退出,容器反复重启。
- alpha.3 在这类 CPU 上改用 SSE 编码的 AES 指令,结果与其他 CPU 相同。根模块和 relaykit 同步升级,THIRD-PARTY-LICENSES 中的版本号同步更新。

Fixes #8314

* feat: add doubao-seedream-5-5-261028 (#8324)

* docs(plugins): recommend a summary length that fits one marketplace line

The plugin site's marketplace list shows meta.description on one line
and cuts longer summaries off with an ellipsis. Measured on the live
list at desktop width, the summary column is 572 px at 14 px: 40 Chinese
characters fit and 41 do not, and real summaries of up to 80 columns
(CJK and full-width punctuation counting as two) all fit.

Add a "Plugin summary length" section to the API reference recommending
at most 80 columns per locale, with guidance on what to leave to the
usage guide, and point the manifest table and the Meta type at it.

* feat(plugins): 请求处理插件可声明作用范围,管理员确认一次即自动覆盖 (#8335)

* feat(plugins): let request plugins declare where they run

A request processing plugin can declare meta.scope: the models and
channel types it is made for. An administrator confirms that scope once
("Where the plugin suggests") and the instance then runs on every
matching request, new channels and models included. The instance runs
only where both the confirmed scope and the plugin's current scope hold,
so an update that narrows the scope applies at once and one that widens
it waits until an administrator confirms it again. The save API accepts
only the declared scope or the one saved before.

Instances placed by hand work as before.

* feat(plugins): let several plugins declare one channel type

A built-in channel type used to belong to one plugin: a second plugin
declaring it was rejected with "channelType N conflicts". Community
plugins for the same vendor (several Zhipu plugins, say) could not be
enabled together.

Now every plugin declaring a channel type is indexed for it. A channel
of the type serves each of them: its plugin extensions list their models,
and a request runs the plugin whose model it asks for, the first in key
order when several share the model. Model names that differ only in case
and protocol clashes still conflict.

* fix(plugins): match each request plugin scope on its own (#8341)

An instance with a plugin scope runs where both the confirmed scope and
the scope its plugin declares now hold the request. The two lists were
intersected word for word, so a confirmed gpt-4o and a declared
gpt-4o@effort:high shared nothing and the instance was skipped for
gpt-4o@effort:high, which both hold. Each scope now matches the request
on its own, modifiers included, and the instance runs when both match.

The docs also say that a task submitted before a scope change still
reports to the instances it stored, as for hand-placed instances.

* docs(github): slim agent issue and PR templates (#8344)

Move the out-of-scope list, filing gates, required facts, and writing
rules from the agent templates into .agents/github/CHECKS.md, so the
posted body keeps only Agent, Request summary, Summary, Evidence, and
Merge Danger or Blast Radius.

Replace the verbatim user request with a short summary, collapse the
Agent block to one line, and require a diagram in Summary when a PR
changes a flow, call chain, state, or layout.

* fix(relay): keep request-triggered errors from disabling channels (#8345)

Errors new-api raises itself because of the request no longer count
against the channel:

- A param override condition that meets a request value of another type
  (for example a string temperature in a numeric gt rule) now returns a
  400 invalid_request that is not retried, instead of
  channel:param_override_invalid, which was retried on every channel and
  could auto-disable each of them. Invalid rules that fail every request
  (non-numeric rule value, unsupported mode) stay channel errors.
- Image conversion failures use the shared convert-request-failed error,
  so they are no longer retried on other channels.
- Automatic channel disabling skips errors classified as local by the
  request policy log, so a local status or a disable keyword echoed from
  client input cannot disable a channel. Upstream responses that adaptors
  report as new-api errors, and local wrappers around an upstream error,
  keep their upstream classification. The logged health entry now uses
  the same decision.

* docs(github): let core maintainers skip agent issue and PR templates (#8352)

* fix(web): collapse special group ratio rules by default

* fix(channel): read batch tag changes within the transaction

Rebuild abilities from the channels read through the same transaction that updates their tags. Add regression cases for setting and clearing tags, preserving routing fields, and leaving unselected channels unchanged.

Validation: go test ./model -count=1 -v -run 'TestBatchSetChannelTag|TestUpdateChannelStatus|TestChannelOtherInfo' passed with SQLite 3.50.4, MySQL 8.0.46, and PostgreSQL 16.15. The regression fails against the previous implementation.

* fix(web): unify cache billing categories and duration labels

Share cache pricing labels across the editor, pricing pages, usage logs, and estimator. Distinguish GPT 30m/12h, Claude 5m/1h, generic cache reads, and custom configurations while preserving existing prices.

Add regression coverage and translations for all seven locales. Verified 832 related tests, focused final UI tests, type checking, lint, production build, and desktop/mobile browser checks.

* fix(relaykit): join Gemini text parts verbatim in chat responses (#8136)

Gemini may split one answer across several text parts. The Chat
converters inserted a newline between consecutive text parts and
dropped parts that were exactly "\n", so JSON split inside a key,
string, number or escape reached clients as invalid JSON, and other
text was silently altered.

Plain text parts are now written as-is and empty parts add nothing;
only rendered media, code and stream thought blocks keep their newline
separation. Grounding citations use the byte offsets recorded while
rendering instead of searching the output, so preserved newlines next
to those blocks are cited at their real position.

* fix(relaykit): map Gemini 4 thinking levels per model (#8367)

Treat gemini-4-hydrogen as a thinkingLevel model so cross-protocol requests apply the requested strength. Pass xhigh and max through on hydrogen, pass max through on argon, and keep mapping minimal to low on both.

Closes #8364

* fix(relay): apply GPT-6 chat parameter rules to gpt-6.2-astra and gpt-6.2-sol (#8375)

* docs(security): document expected access to Midjourney images (#8383)

* docs(security): clarify scope for root-published site content (#8384)

* fix(auth): reject API keys of deleted users with 401 (#8381)

* fix(auth): reject API keys of deleted users with 401

Self-deleting an account soft-deletes the user but keeps its API keys.
TokenAuth and TokenAuthReadOnly treated the missing user as a database
failure and answered 500 "database error"; answer 401 invalid token
instead, the same as an unknown key.

* test(auth): cover deleted-user keys with a warm Redis user cache

* perf(relay): parallelize image compression with moego WebP

* fix: 修复图片任务插件参数覆盖并补充百炼回归测试 (#8027)

* fix: 修复图片任务插件参数覆盖并补充百炼回归测试

* fix(task): isolate channel headers and track retry attempts

* fix(task): keep polling nonterminal tasks at full progress (#8201)

* fix(task): build text-only multipart requests from JSON (#8198)

* fix(task): build text-only multipart requests from JSON

* fix(task): preserve client content type across multipart retries

* fix(task): 修复私有渠道的任务媒体下载 (#8199)

* fix(task): allow media downloads from the task channel origin

* fix(task): recognize default ports on IPv6 media origins

* fix(relaykit): match Gemini 4 thinking levels by family prefix (#8412)

* fix(relaykit): match Gemini 4 thinking levels by family prefix

* fix(relaykit): cap Gemini 4 effort at documented thinking levels

* feat(kling): map sizes to the 4:3 and 3:4 aspect ratios of kling-4.0 (#8348)

* fix(pricing): 修复模型广场显示私有分组的问题

按访问者的可用分组过滤模型标签、性能明细和汇总。管理员后台通过独立接口读取全站性能数据。

* chore(deps): 升级 moego 至 v0.1.0-alpha.5 并统一正则库

* fix(payment): verify partner ID on Epay RSA callbacks (#8422)

Verify that the callback pid matches the configured Epay PartnerID when RSA signing mode is enabled across EpayNotify, SubscriptionEpayNotify, and SubscriptionEpayReturn.

MD5 callbacks preserve existing behavior, and mismatched or missing RSA callback pid values are logged and rejected before settlement.

* fix(deepseek): report supported endpoint metadata (#8296)

* fix: report DeepSeek endpoint metadata accurately

* fix(web): keep Gemini product name in Vietnamese

* docs(web): document endpoint display helpers

* fix(relay): route converted DeepSeek Claude requests to Responses

* fix(web): copy endpoint identifiers from model badges

* docs(relay): explain DeepSeek Responses URL routing

* chore(deepseek): narrow PR to endpoint metadata

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: RedwindA <[email protected]>
Co-authored-by: feitianbubu <[email protected]>
Co-authored-by: Seefs <[email protected]>
Co-authored-by: undercat <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CaIon <[email protected]>
Co-authored-by: jimmyleocn <[email protected]>
Co-authored-by: JY <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Perfecto <[email protected]>
Co-authored-by: Alear03030 <[email protected]>
Co-authored-by: 101Harry <[email protected]>
Co-authored-by: Wang <[email protected]>
Co-authored-by: markcheney1 <[email protected]>
Co-authored-by: Longtsing <[email protected]>
Co-authored-by: longtsing <[email protected]>
Co-authored-by: Yorick <[email protected]>
Co-authored-by: Kc <[email protected]>
Co-authored-by: QuentinHsu <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: spizzkid23 <[email protected]>
Co-authored-by: 翅膀喵 <[email protected]>
Co-authored-by: Adam.Diu <[email protected]>
Co-authored-by: Sky <[email protected]>
Co-authored-by: Rinvay.H <[email protected]>
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