Repository navigation
merge(upstream): sync new-api v1.0.0-rc.51 - #77
Merged
Merged
Conversation
…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>
…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
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
Author
|
合并后待办:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 关联任务 / Related Issue
🚀 变更类型 / Type of change
📝 变更描述 / Description
合入上游 rc.51(基线 rc.47,79 commit),只解冲突不重构上游代码。
PanicRecover保留 JSON 分支;二开重复的ErrorLogWriter()改用上游变量/docs(pkg/jsplugin/routing_tokenfunc.go)MoeForge/moejs:Dockerfile、CI、scripts/tokenfunc/tke-local-image.shReloadChannelHealthStates在 DB 未初始化时返回scripts/tokenfunc/upstream-diff.sh的 SIGPIPE(退出 141)。📸 运行证明 / Proof of Work
go build ./... && go vet ./...:通过;relaykit/tokenkitGOWORK=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 TABLE0 行、SQL 1524 行;日志tokenfunc v0.0.0 已启动/api/statustheme=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 私有合并)
)逐字节重算括号,构造输入可二次复杂度 DoSBugfix(重点 15 条,其余为 relay 协议细节)
Feature(主要 10 条)
其它(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 路径改名)。风险
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)、侧栏 hookssystem_sync_topics、渠道插件凭据表等;敏感词 option 一次性迁移并删除原键 → 需迁移幂等验证common.Marshal外壳不变)origin/worktree-feat-mobile-responsive(10-27,已陈旧),不撞建议:合入 rc.51
评估清单
上游同步评估:v1.0.0-rc.51
e835b1bfc)1. 真冲突文件(git merge-tree 预判)
2. 高风险改动(model/、go.mod、迁移、middleware、计费读门文件)
go.mod← c9c6da2 7b857f5 f3d8b73 579573a 70e6af6 3150dfego.sum← c9c6da2 7b857f5 f3d8b73 579573a 70e6af6 3150dfemiddleware/access_token_routes.go← 7b857f5 883eeb8middleware/auth_test.go← 7061447middleware/distributor_test.go← f3d8b73 c59f6fdmiddleware/distributor.go← 7b857f5 f3d8b73 70e6af6 c59f6fdmiddleware/gzip_test.go← f366017middleware/gzip.go← f366017middleware/logger_test.go← c59f6fd 4193734middleware/logger.go← c59f6fd 4193734middleware/recover.go← 4193734middleware/task_plugin_model.go← 70e6af6middleware/task_plugin_test.go← f3d8b73 c59f6fdmiddleware/task_plugin.go← 7b857f5 f3d8b73 70e6af6 c59f6fdmodel/ability.go← 7b857f5model/auth_cache_integrity_test.go← 7061447model/auth_cache_integrity.go← 7061447model/auth_flow.go← 7b857f5model/channel_balance.go← 7b857f5model/channel_cache.go← 7b857f5model/channel_constraint_test.go← 7b857f5model/channel_constraint.go← 7b857f5 26c488cmodel/channel_plugin_credential_test.go← 7b857f5model/channel_plugin_credential.go← 7b857f5model/channel_priority.go← 7b857f5model/channel_status_test.go← 7b857f5 ada15c0model/channel.go← 7b857f5 ada15c0 83b18femodel/custom_oauth_provider.go← 7b857f5model/json_column_test.go← f3d8b73model/log.go← 7b857f5model/model_meta.go← 7b857f5model/model_metadata_sync.go← 7b857f5model/model_pricing_config.go← 7b857f5 72f3dc7 883eeb8model/model_pricing_conversion.go← 7b857f5model/option_auto_group_test.go← 7b857f5model/option_task_plugin_test.go← 7b857f5model/option.go← 7b857f5 579573amodel/passkey_option.go← 7b857f5model/pricing_usage_schema_test.go← 7b857f5 72f3dc7 883eeb8model/pricing.go← 7b857f5model/request_policy_test.go← 7b857f5model/request_policy.go← 7b857f5 f3d8b73model/sensitive_word_migration_test.go← 7b857f5model/sensitive_word_migration.go← 7b857f5model/subscription.go← 7b857f5model/system_sync_task.go← 7b857f5model/system_task_test.go← 7b857f5model/system_task.go← 7b857f5model/task_model_alias.go← c59f6fdmodel/task_plugin.go← 7b857f5model/task.go← 7b857f5model/token_cache.go← 2de51a1 7061447model/token.go← 7061447model/twofa.go← 9b473a3model/user_auth_cache.go← 2de51a1 7061447model/user_authentication_test.go← 9b473a3model/user_cache_auth_version_test.go← 2de51a1 7061447model/user_cache.go← 7061447model/user_session.go← 7061447model/user.go← 7061447pkg/billingexpr/compile.go← 7b857f5pkg/billingexpr/expr.md← 7b857f5 70e6af6pkg/billingexpr/run.go← 70e6af6relay/common/relay_info.go← 7b857f5 70e6af6relay/helper/billing_expr_request.go← f3d8b73relay/helper/price.go← f3d8b73relay/helper/valid_request.go← f3d8b73relay/image_handler.go← 7b857f5 f3d8b73relay/relay_task.go← 7b857f5relay/request_billing.go← 7b857f5service/log_info_generate.go← 7b857f5service/quota.go← 7b857f5service/task_billing.go← 7b857f5setting/billing_setting/tiered_billing_test.go← 7b857f5setting/billing_setting/tiered_billing.go← 7b857f53. 与二开热点重叠(我们改过、上游也改了的文件)
.env.example← 7b857f5 bd6bb53 45746ee.github/workflows/electron-build.yml← f3d8b73.github/workflows/release.yml← f3d8b73common/constants.go← 45746eecommon/database.go← 9c2c370common/init.go← 7b857f5 9c2c370 45746eecommon/sys_log.go← bd6bb53 4193734controller/channel_authz.go← 7b857f5controller/channel-test.go← 7b857f5 70e6af6controller/channel.go← 7b857f5 433830b 94b5216 83b18fecontroller/relay_task_plugin_test.go← c59f6fdcontroller/relay.go← 7b857f5 ea343c4 c59f6fd e449cc7controller/system_task_handlers.go← 7b857f5controller/topup.go← 579573acontroller/user.go← 7b857f5Dockerfile← f3d8b73docs/openapi/api.json← 83b18feelectron/package.json← ee0f0acgo.mod← c9c6da2 7b857f5 f3d8b73 579573a 70e6af6 3150dfego.sum← c9c6da2 7b857f5 f3d8b73 579573a 70e6af6 3150dfei18n/keys.go← 7b857f5i18n/locales/en.yaml← 7b857f5i18n/locales/zh-CN.yaml← 7b857f5i18n/locales/zh-TW.yaml← 7b857f5main.go← 7b857f5 bd6bb53 4193734middleware/access_token_routes.go← 7b857f5 883eeb8middleware/auth_test.go← 7061447middleware/distributor_test.go← f3d8b73 c59f6fdmiddleware/distributor.go← 7b857f5 f3d8b73 70e6af6 c59f6fdmiddleware/logger.go← c59f6fd 4193734middleware/recover.go← 4193734model/ability.go← 7b857f5model/channel_cache.go← 7b857f5model/channel_constraint_test.go← 7b857f5model/channel.go← 7b857f5 ada15c0 83b18femodel/log.go← 7b857f5model/option.go← 7b857f5 579573amodel/request_policy.go← 7b857f5 f3d8b73model/system_task.go← 7b857f5model/token.go← 7061447model/user.go← 7061447relay/channel/advancedcustom/adaptor.go← 7b857f5relay/channel/api_request.go← 7b857f5 f3d8b73relay/chat_completions_via_responses.go← 7b857f5relay/common/relay_info.go← 7b857f5 70e6af6router/api-router.go← 7b857f5 883eeb8router/channel-router.go← 7b857f5service/log_info_generate.go← 7b857f5service/quota.go← 7b857f5service/relay_error.go← 7b857f5setting/model_setting/global.go← f3d8b73web/bun.lock← b20e056 0bda086 7743627 1e8c707 6e78cb3 9fc70bb cef7820 1695171 9eda50aweb/package.json← b20e056 0bda086 7743627 1e8c707 6e78cb3 9fc70bb cef7820 1695171 9eda50aweb/src/components/__tests__/command-menu.test.tsx← 7b857f5web/src/features/auth/components/legal-consent.tsx← 8faf1d4web/src/features/auth/index.ts← 6ef123cweb/src/features/channels/api.ts← 7b857f5web/src/features/channels/components/channels-columns.tsx← 7b857f5web/src/features/channels/components/channels-primary-buttons.tsx← 7b857f5web/src/features/channels/components/data-table-row-actions.tsx← 7b857f5web/src/features/channels/components/dialogs/channel-test-dialog.tsx← 7b857f5web/src/features/channels/components/drawers/channel-mutate-drawer.tsx← 1122e0f 7b857f5 be5e315 94b5216web/src/features/channels/constants.ts← 7b857f5web/src/features/channels/lib/channel-actions.ts← 7b857f5web/src/features/channels/lib/channel-configuration.ts← 7b857f5web/src/features/channels/lib/channel-form.ts← 7b857f5 94b5216web/src/features/channels/types.ts← 7b857f5 94b5216web/src/features/system-info/components/system-instances-panel.tsx← 7b857f5web/src/features/system-settings/billing/index.tsx← 579573aweb/src/features/system-settings/billing/section-registry.tsx← 579573aweb/src/features/system-settings/models/ratio-settings-card.tsx← 72f3dc7web/src/features/system-settings/request-policies/__tests__/settings.test.tsx← 7b857f5web/src/features/system-settings/request-policies/defaults.ts← 7b857f5web/src/features/system-settings/types.ts← 7b857f5 579573aweb/src/features/usage-logs/components/columns/common-logs-columns.tsx← 7b857f5web/src/features/usage-logs/components/dialogs/details-dialog.tsx← 7b857f5web/src/features/usage-logs/types.ts← 7b857f5web/src/features/users/components/users-mutate-drawer.tsx← 6ef123cweb/src/hooks/__tests__/sidebar-config.test.tsx← 883eeb8web/src/hooks/use-sidebar-data.ts← 7b857f5 883eeb8web/src/hooks/use-sidebar-view.ts← 883eeb8web/src/i18n/locales/en.json← 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/fr.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/ja.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/ru.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/vi.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/zh-TW.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/i18n/locales/zh.json← 87c8848 6ef123c 7b857f5 579573a 8faf1d4 6fa80ab 72f3dc7 e3e7420 94b5216 c59f6fd 883eeb8web/src/routeTree.gen.ts← 7b857f54. 上游 commit 清单(逐条填「决定」:接受 / 回退 / 需适配)
🤖 Generated with Claude Code
https://claude.ai/code/session_01TUuBn5nexoyaCtzH1pqWVK