Skip to content

merge(upstream): sync new-api v1.0.0-rc.51 - #77

Merged
heiying0917 merged 84 commits into
mainfrom
sync/upstream-v1.0.0-rc.51
Nov 19, 2026
Merged

heiying0917 merged 84 commits into
mainfrom
sync/upstream-v1.0.0-rc.51

Conversation

@heiying0917

@heiying0917 heiying0917 commented Nov 19, 2026 •

Copy link
Copy Markdown

本 PR 由 Claude Code AI 辅助完成(合并、解冲突、适配与验证),已由提交者审阅。

🔗 关联任务 / Related Issue

  • 上游同步:new-api v1.0.0-rc.47 → v1.0.0-rc.51

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)

📝 变更描述 / Description

合入上游 rc.51(基线 rc.47,79 commit),只解冲突不重构上游代码。

  • 收益:3 个安全修复(zstd 解压炸弹 f366017、日志打码二次复杂度 a2defd2、vchart tooltip XSS 9eda50a);计费口径修复(9823ebc7e:cache_creation_input_tokens 按缓存写入价计);鉴权缓存自愈 7061447;节点同步表(多副本配置秒级生效);插件体系 7b857f5(默认不启用)。
  • 冲突 28 文件:二开挂载点两边都保留(企业用量 / 渠道消耗统计 / 外部渠道健康 / JSON 日志 / 定时任务)。
  • 需适配项及处理:
    • 日志:访问日志处理完再取 query(上游 fix(logger): keep gin access and recovery logs on the current log file after rotation QuantumNous/new-api#8098 语义);PanicRecover 保留 JSON 分支;二开重复的 ErrorLogWriter() 改用上游变量
    • 插件路由保留命名空间补上二开控制台页与 /docs(pkg/jsplugin/routing_tokenfunc.go)
    • moejs 改名 MoeForge/moejs:Dockerfile、CI、scripts/tokenfunc/tke-local-image.sh
    • 侧栏:「插件」「请求处理」放进「运维中心」分组
    • ReloadChannelHealthStates 在 DB 未初始化时返回
  • 回退项:无。插件市场默认源 www.newapi.ai 保留(仅超管可见)。
  • 顺带修 scripts/tokenfunc/upstream-diff.sh 的 SIGPIPE(退出 141)。

📸 运行证明 / Proof of Work

  • go build ./... && go vet ./...:通过;relaykit / tokenkit GOWORK=off go build ./...:通过
  • make test:仅 TestTaskMediaResponseHeaderTimeoutDoesNotTruncateBody 在与前端测试并发时超时,单独跑 3 次全部通过
  • make test-db(PG):全部通过
  • bun run typecheck:0 错误;bun run test:3621/3623,2 个 20s 超时用例单独跑通过;bun run i18n:sync:locale 无 diff,_extras 为空
  • 迁移幂等:make api TF_API_PORT=3003 → make api-stop → DEBUG=true make api TF_API_PORT=3003,ALTER TABLE 0 行、SQL 1524 行;日志 tokenfunc v0.0.0 已启动
  • 冒烟:/api/status theme=tokenfunc;企业列表 / 报价配置 / 授信账期 / 财务总览 / 导出 CSV / 手工充值校验 / 请求插件实例 / /api/system-info/sync 正常;本地 mock 上游流式 + 非流式 chat,消费日志 12+5 token、quota 7

✅ 提交前检查项 / Checklist

  • 人工确认
  • 范围聚焦: 上游同步 + 必要适配
  • 本地验证
  • 安全合规
变更摘要(P2.5)

上游 v1.0.0-rc.51 变更摘要(基线 rc.47 → rc.51,79 commit,2026-10-25 ~ 11-13)

安全修复(3 条,GHSA 私有合并)

sha 修了什么 影响面 对 tokenfunc
f366017 zstd 请求体解压窗口限 8 MiB + 受 body 上限约束,防解压炸弹 客户可感知(公网 DoS) 需要
a2defd2 MaskSensitiveInfo 末尾 ) 逐字节重算括号,构造输入可二次复杂度 DoS 客户可感知(DoS) 需要
9eda50a vchart 2.1.7,tooltip 标题按文本渲染(XSS) 管理端 需要

Bugfix(重点 15 条,其余为 relay 协议细节)

sha 修了什么 影响面 对 tokenfunc
5478811 非流式请求已完成但客户端断开时,性能指标记成失败(仅模型性能统计,与计费无关) 管理端 顺带
9823ebc prompt_tokens_details 里的 cache_creation_input_tokens 按普通输入价计(应按缓存写入价,如阿里百炼) 计费(口径) 需要
ea343c4 插件流式任务预扣 / 落库失败时漏计费 计费 顺带
ba5f736 Gemini embedding 按上游 usageMetadata 计费 计费 顺带
651d5a2 xAI 流式 usage 丢 token 明细 计费 顺带
7061447 Redis 鉴权缓存有坏字段时每请求回源 DB 且永不修复 二开直接依赖(model/user.go、token.go) 需要
2de51a1 用户 / 令牌缓存 Lua 脚本在集群 Redis 跨槽 内部 无关(生产 Redis 按 DB 号,非集群)
9b473a3 2FA 锁定过期后失败计数不清零 客户可感知 需要
48a6c87 OAuth 注册不记录邀请人 客户可感知 顺带
ada15c0 / 433830b 手动禁用的渠道被请求失败逻辑改状态;多 key 全失效后启用 key 不恢复渠道 管理端 需要
fcc241c 亲和回退不从最高优先级开始 客户可感知 顺带
55515db / 4d962e4 / 0165fef / bc795cc / 0409dec 流结束标记、Claude 工具参数数字、Gemini 文本+工具、stop 非字符串、DeepSeek developer 角色 客户可感知(协议转换) 顺带
4193734 日志轮转后 gin 访问 / panic 日志不再进文件 二开直接依赖(main.go、logger.go、recover.go 我方有 JSON 日志) 顺带(TKE 走 stdout)
c9c6da2 moego 在无 AVX CPU 上 SIGILL 内部 必须随 moego 一起进

Feature(主要 10 条)

sha 加了什么 影响面 对 tokenfunc
7b857f5 提供商插件 / 请求插件 / 社区市场 / 节点同步表(395 文件 +6.9 万行);敏感词首启迁成请求过滤插件实例 二开直接依赖(channel/option/request_policy/main/计费读门文件) 中性:插件按需启用;节点同步对 TKE 多副本有用
f3d8b73 / 70e6af6 JSON 编解码换 moego(alpha),请求体按需流式读取,修透传重试共用游标发残缺 body 热路径 有用但有风险(alpha 库)
c59f6fd / 8c8940c / 1424ffd 任务插件按厂商原路径服务 客户可感知 中性
45746ee 可选 HTTP/2 健康检查 内部 中性(默认关)
bd6bb53 HOST 环境变量设监听地址 内部 中性
579573a 易支付 RSA 签名 管理端 中性
83b18fe / 94b5216 建渠道返回 ID;Vertex v1beta1 开关 管理端 中性
e8298df 高级自定义渠道 DeepSeek 搜索路径选项 管理端 有用(我方用高级自定义)
6ef123c 密码强度校验与提示 客户可感知 有用
d0abbf6 / c046559 / dd50ee0 Gemini Omni 视频插件 客户可感知 中性(无 Vertex 渠道)

其它(chore / deps,约 15 条)

前端依赖批量升级(0bda086fb、tailwind-merge、marked、knip、DOMPurify 3.4.17);electron 42;go-jose 4.1.6;moejs 迁 MoeForge/moejs(Dockerfile / release.yml 的 PGO 路径改名)。

风险

  • 真冲突 28 文件 / 约 40 块;二开热点:main.go(2)、common/sys_log.go(2)、middleware/logger.go、model/channel.go(2)、model/request_policy.go、model/log.go、service/log_info_generate.go(计费读门)、i18n/keys.go、Dockerfile、release.yml(4)、bun.lock(8)、侧栏 hooks
  • 需适配:7b857f5a1(request_policy 敏感词键被迁走,我方外部探测接线要随新结构重接)、4193734a2(我方 JSON 日志分支与上游 LogWriter 合并)、f3d8b737b(Dockerfile PGO 路径)、706144769(user/token 缓存)
  • 迁移:新表 system_sync_topics、渠道插件凭据表等;敏感词 option 一次性迁移并删除原键 → 需迁移幂等验证
  • 上游机制:i18n/keys.go 有新增;JSON 底层换 moego(common.Marshal 外壳不变)
  • rc.51 之后 main 仍在修请求插件(57345547b、09ac035a2),另有 3a407cc(已删除用户的 key 返回 401)、1c63cc8c9(请求侧错误不再禁用渠道)未进 rc
  • 在飞分支:只有 origin/worktree-feat-mobile-responsive(10-27,已陈旧),不撞

建议:合入 rc.51

  1. 收益:3 个安全修复 + 计费口径 fix(cache_creation 按缓存写入价计)+ 鉴权缓存自愈;节点同步表直接改善 TKE 多副本的配置生效延迟。
  2. 成本:约 40 个冲突块,可控;最大风险是 moego alpha 进 JSON 热路径,用门禁 + 本地 relay 冒烟兜底,SIGILL 修复已含。插件全部默认不启用。
  3. 时机:等 rc.52 不会减少冲突(只会更多),rc.51 之后的修复集中在默认关闭的请求插件;3a407cc9b / 1c63cc8 下一轮再合或走 cherry-pick。
评估清单

上游同步评估:v1.0.0-rc.51

项 值
基线(当前已合入的上游 rc) v1.0.0-rc.47(merge-base e835b1bfc)
本次范围 79 个 commit,2026-10-25 ~ 2026-11-13
真冲突文件 28
高风险文件 75
与二开热点重叠的文件 89

1. 真冲突文件(git merge-tree 预判)

  • .env.example
  • .github/workflows/electron-build.yml
  • .github/workflows/release.yml
  • Dockerfile
  • common/database.go
  • common/sys_log.go
  • controller/channel_authz.go
  • controller/system_task_handlers.go
  • i18n/keys.go
  • main.go
  • middleware/logger.go
  • model/channel.go
  • model/channel_cache.go
  • model/channel_constraint_test.go
  • model/log.go
  • model/request_policy.go
  • model/system_task.go
  • relay/channel/api_request.go
  • service/log_info_generate.go
  • service/relay_error.go
  • web/bun.lock
  • web/package.json
  • web/src/features/auth/components/terms-footer.tsx
  • web/src/features/channels/components/channels-columns.tsx
  • web/src/features/channels/types.ts
  • web/src/hooks/use-sidebar-data.ts
  • web/src/hooks/use-sidebar-view.ts
  • web/src/routeTree.gen.ts

2. 高风险改动(model/、go.mod、迁移、middleware、计费读门文件)

3. 与二开热点重叠(我们改过、上游也改了的文件)

4. 上游 commit 清单(逐条填「决定」:接受 / 回退 / 需适配)

sha 类型 标题 决定 备注
9823ebc fix fix(billing): bill cache_creation_input_tokens reported in prompt_tokens_details (QuantumNous#7909)
bc795cc fix fix:修复stop为非字符串和[]string的协议转换问题 (QuantumNous#7935)
f1569d1 fix fix(pricing): classify dynamic per-request billing correctly (QuantumNous#8010)
4d962e4 fix fix(relaykit): preserve tool argument numbers in Claude responses (QuantumNous#7996)
0165fef fix fix(relaykit): preserve Gemini text alongside tool calls (QuantumNous#7998)
34003e9 test test: stabilize channel affinity cache keys (QuantumNous#8009)
01da3a5 perf perf(relay): stop recompiling param override regexes on every request (QuantumNous#8061)
ad56112 fix fix(relay): apply GPT-6 chat parameter rules to gpt-6.1-sol and gpt-6.1-terra (QuantumNous#8064)
5478811 fix fix: count completed non-stream relays after context cancellation (QuantumNous#7844)
49271d2 fix fix(aws): preserve safeguards in Bedrock Invoke requests (QuantumNous#8071)
55515db fix fix(relay): terminate streams on exact bare done markers (QuantumNous#8074)
26c488c fix fix(relay): allow Azure channels to opt in to Responses WebSocket (QuantumNous#8047) (QuantumNous#8075)
b08ee86 fix fix(cloudflare): preserve embedding response data (QuantumNous#8041)
fcc241c fix fix: start affinity fallback at the highest channel priority (QuantumNous#8078)
e449cc7 feat feat: sample immediate task successes in model performance metrics (QuantumNous#8067)
a2defd2 other Merge commit from fork
9eda50a other Merge commit from fork
829f082 fix fix: unmount authenticated layout on sign-out to stop credential-less refetches (QuantumNous#8110)
f366017 other Merge commit from fork
4193734 fix fix(logger): keep gin access and recovery logs on the current log file after rotation (QuantumNous#8098)
a3851c2 fix fix: save Turnstile keys before enabling (QuantumNous#7960)
3150dfe chore chore(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6 (QuantumNous#8112)
837b814 chore chore(deps): bump undici in /electron (QuantumNous#8006)
ee0f0ac chore chore(deps-dev): bump electron from 41.10.6 to 42.11.16 in /electron (QuantumNous#8008)
7fa815e chore chore(deps-dev): bump fast-uri from 3.1.7 to 3.1.9 in /electron (QuantumNous#8007)
1695171 chore chore(deps): bump tailwind-merge from 3.6.0 to 3.7.0 in /web (QuantumNous#8106)
cef7820 chore chore(deps-dev): bump knip from 6.27.0 to 6.43.0 in /web (QuantumNous#8105)
9fc70bb chore chore(deps-dev): bump @tanstack/react-query-devtools in /web (QuantumNous#8104)
6e78cb3 chore chore(deps): bump marked from 18.0.6 to 18.1.2 in /web (QuantumNous#8103)
1e8c707 chore chore(deps): bump @codemirror/language from 6.12.4 to 6.13.1 in /web (QuantumNous#8102)
883eeb8 feat feat(plugins): warn about task models a plugin cannot charge
7743627 fix fix(deps): upgrade DOMPurify to 3.4.17 (QuantumNous#8116)
37d23dc fix fix(profile): honor global sidebar visibility (QuantumNous#7429)
c59f6fd feat feat(plugins): serve task plugins at the vendors' own paths and answer as the vendors do (QuantumNous#8117)
8b253de fix fix(plugins): keep Kling 4.0 durations in range and map every video size (QuantumNous#8118)
1424ffd fix fix(plugins): load plugins that declare their own /{key} address (QuantumNous#8119)
fe57cba fix fix(plugins): prefer Kling's returned price (list_price) for Kling 4.0 cash billing (QuantumNous#8125)
ea343c4 fix fix(plugins): charge relayed streams even when the reserve or task insert fails (QuantumNous#8121)
d0abbf6 feat feat(plugins): generate video with Gemini Omni on Vertex AI channels (QuantumNous#8142)
70e6af6 perf perf: read and edit request JSON and base64 with moego (QuantumNous#8148)
651d5a2 fix fix(xai): preserve token details in stream usage conversion (QuantumNous#6420)
c046559 feat feat(plugins): bill gemini omni by the tokens vertex reports (QuantumNous#8153)
45746ee feat feat(relay): add opt-in HTTP/2 health checks (QuantumNous#8059)
9b473a3 fix fix(twofa): restart the failure count after a lockout expires (QuantumNous#8172)
52c1730 feat feat(gemini): add Argon fields and reasoning mappings (QuantumNous#8177)
83b18fe feat feat(channel): return created IDs with input mappings (QuantumNous#8164)
94b5216 feat feat(vertex): add per-channel v1beta1 endpoint switch (QuantumNous#8179)
ba5f736 fix fix(gemini): bill embeddings from upstream usageMetadata (QuantumNous#8182)
7061447 fix fix(auth): 校验 Redis 鉴权缓存完整性 (QuantumNous#8200)
3374f25 feat feat: forward image complexity and markup for gpt-image-2.6 (QuantumNous#8208)
e3e7420 fix fix(pricing): guide users through model pricing issues
72f3dc7 fix fix(pricing): review model price changes before saving
2de51a1 fix fix(cache): 修复用户和令牌缓存的 Redis 跨槽错误 (QuantumNous#8218)
6fa80ab fix fix: clarify session cache actions and expose per-rule clearing
a5a4659 fix fix(vertex): cache service-account access tokens until they expire
e034390 refactor refactor(aws): remove the unused api_key HTTP request path
8c8940c fix fix(plugins): serve uploaded plugins at top-level /v1 paths (QuantumNous#8241)
433830b fix fix(channel): restore a multi-key channel when a key is enabled after all keys failed
ada15c0 fix fix(channel): keep a manual channel disable when a request fails
9c2c370 fix fix(sqlite): keep the default SQLite settings when SQLITE_PATH is a plain path
a3fd673 feat feat(deepseek): 补全 Responses 工具历史缺失的 reasoning (QuantumNous#8162)
dd50ee0 feat feat(plugins): add gemini omni 1.2 flash and send every input image to vertex (QuantumNous#8228)
e8298df feat feat(channels): 高级自定义渠道增加 DeepSeek 搜索与抓取路径选项 (QuantumNous#8250)
48a6c87 fix fix(oauth): persist inviter when creating OAuth users (QuantumNous#8247)
8faf1d4 fix fix(web): translate legal consent text on auth pages (QuantumNous#8254)
bd6bb53 feat feat: support HOST env to set the listen address (QuantumNous#8269)
0409dec fix fix(deepseek): map developer role to system for chat completions (QuantumNous#8287)
579573a feat feat(payment): 易支付支持 RSA 签名方式 (QuantumNous#8291)
be5e315 fix fix(channels): 切换渠道时重置模型重定向同步状态 (QuantumNous#8304)
a9932d1 fix fix(web): sync risk confirmation text on composition end and blur
f3d8b73 perf perf: 升级 MoeForge moejs/moego,请求体按需流式读取 (QuantumNous#8311)
7b857f5 feat feat(plugins): add provider plugins, request plugins and a community marketplace (QuantumNous#8271)
f2aa912 chore chore(plugins): release vertex-ai 1.3.1 (QuantumNous#8313)
0bda086 chore chore(web-deps): upgrade frontend dependencies (QuantumNous#6999)
6ef123c perf perf(password): improve password validation and feedback (QuantumNous#6928)
87c8848 fix fix(i18n): name the super admin in the compliance lock notice (QuantumNous#6955)
b20e056 fix fix(web): align TanStack router devtools with the router core (QuantumNous#8320)
1122e0f fix fix(web): keep channel plugin settings inside the drawer (QuantumNous#8323)
c9c6da2 fix fix: 升级 moego 到 v0.1.0-alpha.3,修复无 AVX 的 x86-64 CPU 上的 SIGILL 崩溃 (QuantumNous#8322)

🤖 Generated with Claude Code

https://claude.ai/code/session_01TUuBn5nexoyaCtzH1pqWVK

yxkong and others added 30 commits October 25, 2026 17:22
…ens_details (QuantumNous#7909)

OpenAI-compatible upstreams with explicit context cache (e.g. Alibaba Bailian)
report cache-write tokens as prompt_tokens_details.cache_creation_input_tokens.
The field was ignored, so cache-write tokens were billed at the plain input
price instead of the cache-creation price.

Parse it into InputTokenDetails.CacheCreationInputTokens and include it in
CacheCreationTokensTotal using max() with the existing cache-write fields, so
the same tokens are never counted twice.
…Nous#8010)

* fix(pricing): classify dynamic per-request billing correctly

* fix(pricing): classify mixed billing as token-based
…antumNous#7996)

* fix(relaykit): preserve tool argument numbers in Claude responses

* test(claude): assert serialized tool input contract
Replace wall-clock identifiers with an atomic sequence and test names so repeated Windows runs cannot share usage-cache entries.

Verification: latest main baseline failed with cumulative counts; patched affinity tests passed -count=20; full service suite and go vet passed.

Signed-off-by: sstar16 <3221386464@qq.com>
…antumNous#8047) (QuantumNous#8075)

Azure channels with responses_websocket_enabled were rejected by
FilterResponsesWebSocket, and the channel form hid the toggle for type 3.
The OpenAI adaptor already builds the Azure /openai/v1/responses URL with
api-version and sets the api-key header, and DoWssRequest reuses both, so
no relay URL change is needed.
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.
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).
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.
…e 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.
…uantumNous#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…uantumNous#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tumNous#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Nous#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/tailwind-merge@3.7.0/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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#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/knip@6.43.0/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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Nous#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/react-query-devtools@5.105.0/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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…uantumNous#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Calcium-Ion and others added 28 commits November 7, 2026 00:39
…ous#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}.
… 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.
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.
…lain 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.
* fix: 补全 DeepSeek Responses 工具历史的 reasoning

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

* fix: 在参数覆盖后补全 DeepSeek Responses reasoning
…o 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): 添加网页搜索和网页抓取的路径选项

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

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

---------

Co-authored-by: longtsing <wangqinglong605504@cma.cn>
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.
…ntumNous#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 签名方式

支付设置新增「签名方式」,可在 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): reset model redirect sync state when switching channels

* fix(channels): rebase batch redirect sync on current mappings and add regression tests
- 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() 时冻结请求体,其余情况不再读取并保留整份请求体。
…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.
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.
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.
…#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.
…mNous#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".
…mNous#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.
…#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.
…ntumNous#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
# Conflicts:
#	.env.example
#	.github/workflows/electron-build.yml
#	.github/workflows/release.yml
#	Dockerfile
#	common/database.go
#	common/sys_log.go
#	controller/channel_authz.go
#	controller/system_task_handlers.go
#	i18n/keys.go
#	main.go
#	middleware/logger.go
#	model/channel.go
#	model/channel_cache.go
#	model/channel_constraint_test.go
#	model/log.go
#	model/request_policy.go
#	model/system_task.go
#	relay/channel/api_request.go
#	service/log_info_generate.go
#	service/relay_error.go
#	web/bun.lock
#	web/package.json
#	web/src/features/auth/components/terms-footer.tsx
#	web/src/features/channels/components/channels-columns.tsx
#	web/src/features/channels/types.ts
#	web/src/hooks/use-sidebar-data.ts
#	web/src/hooks/use-sidebar-view.ts
#	web/src/routeTree.gen.ts
- 访问日志改为请求处理完再取 path / query,与上游 QuantumNous#8098 一致,处理器摘走的 ?key= 不进日志
- 二开 ErrorLogWriter()/InfoLogWriter() 与上游同名变量重复,改用上游 common.LogWriter / ErrorLogWriter
- 二开控制台页与文档中心加入插件路由保留命名空间(pkg/jsplugin/routing_tokenfunc.go)
- ReloadChannelHealthStates 在 DB 未初始化时直接返回
- 测试:菜单分组下的插件 / 请求处理项、jsdom 30 的 px 计算值、侧栏与密码强度用例补二开 mock

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUuBn5nexoyaCtzH1pqWVK
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUuBn5nexoyaCtzH1pqWVK
@heiying0917
heiying0917 merged commit abd4422 into main Nov 19, 2026
2 checks passed
@heiying0917

Copy link
Copy Markdown
Author

合并后待办:

  • 下一轮同步(rc.52)带上:3a407cc9b(已删除用户的 key 返回 401)、1c63cc8c9(请求侧错误不再禁用渠道)、09ac035a2 / 5734554(请求插件作用域)
  • moego 为 alpha,上线后观察 relay 错误率与 CPU
  • 插件市场默认源 www.newapi.ai / newapi.pro,白标是否改源待定
  • 发版走 /release-tke,报告注明「基于上游 v1.0.0-rc.51」

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.