6756 Commits
Author SHA1 Message Date
RedwindA 6e40d9a639 fix(web): 自定义页脚 HTML 改走 HtmlContent 消毒渲染 (#8558)
* fix(web): sanitize custom footer HTML through HtmlContent

The footer was the only admin-configured HTML still injected with raw
dangerouslySetInnerHTML; it predates the shared HtmlContent hardening
(#5760, 626dadb55) and was never moved over, so inline handlers such as
<img onerror> ran on the home page.

Render it with the isolated HtmlContent variant used by the home, about
and legal pages: DOMPurify strips handlers, target=_blank links get
noopener noreferrer, and Shadow DOM keeps the footer's existing look.
sm:w-auto keeps the attribution column on one line beside it.

Also key the demo-site footer columns by title/href instead of array
index to clear the file's lint errors.

* fix(web): render sanitized footer HTML in the page DOM

The isolated variant put the footer in a Shadow DOM, which cut it off from
the page: in-page anchors to ids in the footer stopped resolving, a lone
badge lost its centering on mobile, theme presets no longer reached links
using the theme colors, and site CSS such as `.custom-footer a` stopped
applying.

Add an `embedded` HtmlContent variant that keeps the isolated variant's
sanitizing (handlers stripped, new-tab links get noopener noreferrer) but
renders into the page DOM, and use it for the footer. The footer no longer
needs the sm:w-auto width fix.
2026-12-05 15:26:40 +08:00
Calcium-Ion 080997bf23 fix(relay): Claude 流开始输出后不再换渠道重试,上游 error 转给客户端 (#8550)
上游在流中途发来 error 事件(如 overloaded_error)时,HandleStreamResponseData
返回 500。重试判断不知道这次尝试已经给客户端写过事件,换渠道重来,新流接在
半截旧流后面,客户端看到两个 message_start;全部失败时还会再补一个 error。

- 还没有事件写给客户端:照旧可以重试。
- 已写出事件但没有输出:不重试,由 relay 在同一条流里发 error 并退款。
- 已有输出:不重试,error 事件转给客户端(保留上游 type 和 message),
  已送达的输出按上游报告的 usage 计费,没报告则按估算。
- Claude 转 Responses:发出 response.failed 后同样只为已送达的输出计费,
  没有输出不收费,流状态记为失败。

controller 的 writeRelayStreamError 移到 helper.StreamErrorData,供 Claude
处理器复用。
2026-12-03 18:34:34 +08:00
Seefs 5911c8cca8 fix(middleware): abort canceled Redis rate-limit checks with 499 (#8512)
Treat Redis rate-limit failures as client-closed (HTTP 499, no error log) only when both the Redis error and request context report context.Canceled, while keeping deadline timeouts and Redis failures fail-closed with HTTP 500.

Closes #8462
2026-12-02 19:06:23 +08:00
Seefs 5f56c685d4 fix(gemini): emit stream finish_reason only in dedicated terminal chunk (#8522)
Stop setting finish_reason=tool_calls unconditionally on every Gemini stream chunk containing a functionCall, omit empty content strings on non-text chunks, and strip upstream finish reasons from payload chunks so GeminiChatStreamHandler and GeminiToChatStreamState emit finish_reason once in an empty-delta terminal chunk.
2026-12-02 19:03:33 +08:00
Seefs 16369071a1 fix(relay): normalize /pg/ playground path for route matching (#8534)
Playground sends chat completions to /pg/chat/completions while GenRelayInfo maps info.RequestURLPath to /v1/chat/completions. Distributor path filters, per-route pass-through lookup in InitChannelMeta, and route resolution in the advanced custom and provider plugin adaptors still read raw c.Request.URL.Path, rejecting advanced custom, vLLM/SGLang preset, and provider plugin channels in Playground.

Add common.NormalizeRelayPath to map /pg/... paths onto /v1/... at the route matching and provider plugin hook boundaries while keeping c.Request.URL.Path unchanged for Playground detection, group selection, and request logs.

Closes #5966
2026-12-02 15:42:41 +08:00
Seefs 1c0b4d6471 fix(billing): cap subscription usage at settlement instead of rejecting overrun (#8523)
* fix(billing): cap subscription usage at settlement instead of rejecting overrun

When a post-request settlement delta exceeds the remaining subscription quota,
PostConsumeUserSubscriptionDelta rejects the whole update and leaves
amount_used below amount_total. Subsequent requests with small pre-consume
estimates keep passing admission and become free, and secondary subscriptions
are never selected.

Add model.SettleUserSubscriptionDelta to cap positive settlement charges at
AmountTotal (or math.MaxInt64 for unlimited plans), log the uncovered
remainder, and return the applied delta. Route SubscriptionFunding.Settle and
async task settlement to it while keeping PostConsumeUserSubscriptionDelta
strict for reservations and Realtime in-session metering, and without changing
the FundingSource interface signature.

* test(billing): add regression coverage for capped subscription settlement

Consolidate regression cases in service/subscription_settle_test.go covering SettleUserSubscriptionDelta finite capping, unlimited MaxInt64 saturation, refund zero-flooring, BillingSession dual-subscription exhaustion and switching, strict PostConsumeQuota rejection for Realtime in-session metering, and async RecalculateTaskQuota overrun capping.
2026-12-02 15:11:32 +08:00
Hao Wang 0d0d396f48 fix(task): find unfinished tasks through the status index (#8529)
HasUnfinishedSyncTasks, GetAllUnFinishSyncTasks and GetTimedOutUnfinishedTasks
exclude the two terminal statuses with "status != ?" or "NOT IN". PostgreSQL
and SQLite cannot use idx_tasks_status for that filter, so every check reads
all finished tasks. The async_task_poll scheduler runs the existence check
every 15 seconds. On a PostgreSQL table with 1.4 million finished tasks, one
check took about 27 seconds, and the database kept scanning the table even
when no task was unfinished.

Write the filter as the key ranges around FAILURE and SUCCESS. It matches the
same rows, and all three databases answer it from the status index.

Closes #8528
2026-12-02 14:45:40 +08:00
coderwhq b697786325 fix(openai): record first response time on first non-empty stream output (#8531) 2026-12-02 14:05:07 +08:00
Seefs f0c94957fd fix(channels): enable VolcEngine upstream model discovery (#8306) 2026-12-02 13:52:23 +08:00
CaIon 04dfcbb712 docs(agents): fix stale facts and trim repeated rules in agent instructions
- web/AGENTS.md: translation keys are English source strings, not
  dotted paths; drop the E2E tools and 80% coverage target the project
  does not use; drop the changelog section.
- vercel-react-best-practices: describe the Rsbuild SPA instead of
  Next.js, Server Components and SWR.
- billing.md: Kling deduction field is final_unit_deduction in the
  plugin.
- AGENTS.md: core maintainers write issues without the agent template,
  as for PRs; replace the all-caps commentary line with a plain one.
- CLAUDE.md, i18n-translate, shadcn-ui: state each rule once and drop
  copied upstream promo text.
v1.0.0-rc.52
2026-11-28 01:12:36 +08:00
Calcium-Ion 944464420b feat(plugin): 插件渠道可按渠道开关提供商插件的路由 (#8482)
同一个提供商插件绑到多个类型 61 渠道时,各渠道的路由完全相同,无法只在部分渠道上
开启某条转换路由。#8478 用 enabled_by 指向 channelConfig 里的 boolean 字段,已回退;
这里改为由渠道直接保存路由开关,插件不用为每条路由声明配置字段。

- meta.relay 的路由新增 default_enabled(默认 true),写 false 的路由新渠道默认不提供;
  管理路由(/v1/models、余额)始终开启,不能写 false。
- 渠道的 other_settings.plugin_routes 保存路由开关,键为 incoming_path,
  带 models 时追加 "|" 和逗号连接的模型名;保存时只保留与默认值不同的项,
  不认识的键丢弃。
- 选渠道、Responses WebSocket 判断、转发、提供商适配器绑定路由、渠道测试选端点、
  上游模型列表和定价端点都只看对该渠道开启的路由;同一路径的其他路由照常匹配。
- 插件选项接口返回 relayRoutes;渠道编辑「路由与映射」页签顶部列出插件路由,
  每条一个开关,补齐七种语言词条。
- pluginkit/v1.md、v1.d.ts、v1.schema.json 补充 default_enabled 与 plugin_routes。

Refs #8466
2026-11-27 23:25:50 +08:00
CaIon d35242c55f chore(plugins): release Kling 1.2.1 2026-11-27 23:19:10 +08:00
Calcium-Ion 50a9767024 fix(relay): return 404 for models missing from all eligible groups (#8480) 2026-11-27 21:37:26 +08:00
Calcium-Ion 5456425f98 Revert "feat(plugin): 提供商插件的路由可按渠道配置开关(enabled_by) (#8478)" (#8479)
This reverts commit 92866e5eac.
relaykit/v0.3.9
2026-11-27 21:00:03 +08:00
Calcium-Ionandzwen 92866e5eac feat(plugin): 提供商插件的路由可按渠道配置开关(enabled_by) (#8478)
同一个提供商插件绑到多个类型 61 渠道时,各渠道的路由完全相同,无法只在部分渠道上
开启某条转换路由(例如只让部分渠道接受 /v1/responses)。

- meta.relay 的路由新增 enabled_by:指向 meta.channelConfig 顶层的一个 boolean 字段;
  加载时校验字段存在且为 boolean,管理路由(/v1/models、余额)不能使用。
- 渠道插件配置(按 schema 默认值补齐后)中该字段不为 true 时,这条路由对该渠道不存在:
  选渠道、Responses WebSocket 判断、转发、提供商适配器绑定路由和渠道测试选端点
  都按渠道配置判断。同一路径的其他路由照常匹配。
- 插件级的 RelayRoute 保持清单原样。enabled_by 只存在于插件清单
  (Meta.RelayEnabledBy,与 Relay 下标对齐),不改高级自定义路由结构。
- 插件 API 文档、v1.d.ts、v1.schema.json 补充 enabled_by。

Closes #8466

Co-authored-by: zwen <49605455+zwenooo@users.noreply.github.com>
2026-11-27 20:33:29 +08:00
zwenooo bea3616473 feat(relay): 路由转换器支持 OpenAI Responses 转 Anthropic Messages (#8465)
relaykit 已注册 openai_responses_to_claude_messages(请求、响应、流式三侧都有实现),
普通 Claude 渠道收到 /v1/responses 时也已经在用它,但高级自定义渠道和提供商插件共用的
路由转换器白名单里没有登记,这两类渠道无法把 /v1/responses 路由到 Anthropic Messages 上游,
插件只能用 converter: "plugin" 在 JS 里重写整套转换。

- relaykit/dto:白名单登记该转换器,incoming_path 限定为 /v1/responses。
- 高级自定义适配器:请求经 ConvertRequestByID 转成 Claude 请求;响应交给 Claude 适配器
  按客户端协议转回 Responses(含流式);发送 anthropic-version 等 Claude 请求头。
- 插件 API 文档、v1.d.ts、v1.schema.json 的转换器表补上该转换器及其 +plugin 链式写法。
- 前端高级自定义路由的转换器选项、默认上游路径(/v1/messages + x-api-key)与路径校验,
  七种语言的选项文案。
2026-11-27 20:13:18 +08:00
feitianbubu d6ab606bd3 feat(hailuo): support MiniMax-H3-Max with its own durations, resolutions and usage profile (#8453) 2026-11-27 20:07:06 +08:00
Calcium-Ion dc2750cd5d fix(pluginkit): 单独构建时使用仓库内的 relaykit (#8477)
pluginkit/go.mod 增加 replace,指向 ../relaykit。之前在 pluginkit 目录
单独构建或测试(CI 与 make test 都会这样跑)时,用的是已发布的
relaykit v0.3.8,同一个 PR 里对 relaykit 的改动在这里看不到,例如新增
的转换器会报 not registered。根模块本来就把 relaykit 替换为 ./relaykit,
所以发布的二进制不受影响;外部依赖 pluginkit 时会忽略这条 replace,
仍按 require 的版本解析。
2026-11-27 19:57:08 +08:00
Calcium-Ion 5ff8157dd2 fix(relaykit): flatten top-level oneOf/anyOf/allOf in Claude input_schema (#8476)
Claude rejects tools whose input_schema has oneOf, anyOf or allOf at the
top level (400 "input_schema does not support oneOf, allOf, or anyOf at
the top level"). Codex Desktop's automation_update tool has such a schema,
so every Responses -> Claude turn that carried it failed.

FunctionParametersToInputSchema now merges the branches into one object
schema: properties are combined (differing same-name schemas go into a
nested anyOf), required is the intersection for oneOf/anyOf and the union
for allOf plus the top level's, and other top-level keywords are kept.
The tool conversion reports claude_top_level_schema_union_flattened.
Schemas without a top-level union are returned byte for byte.
2026-11-27 19:16:11 +08:00
Calcium-Ion 0c1be7b1a9 refactor(plugins): 把插件 API v1 拆成独立模块 pluginkit (#8475)
插件 API v1 的元数据校验、utils、moejs 执行层和任务钩子的结果解析搬到
嵌套模块 github.com/QuantumNous/new-api/pluginkit,按 pluginkit/vX.Y.Z
打标签发布,其他宿主可以直接引用同一份实现。

- pkg/jsplugin 只留注册表、路由和 CLI,现有导出名通过别名保留,行为不变
- 文档 v1.md、v1.d.ts、v1.schema.json 移到 pluginkit/,schema 和类型由模块内嵌
- 请求处理钩子新增宿主专有的 ctx.client、ctx.session,new-api 不提供
- 导出 MaxPluginKeyLength、NewAPIReservedKeys 和 CallPathJSONInto
- CI、Makefile、Dockerfile 和 AGENTS.md 按 relaykit 的方式加上 pluginkit
pluginkit/v0.1.0
2026-11-27 19:12:59 +08:00
Seefs caa32a3012 fix(relay): remove trailing newline from ClaudeChunkData data frame (#8474) 2026-11-27 19:12:18 +08:00
videogen-artandseefs001 3333fc6766 fix(gemini): bill audio inlineData by length, not as images, when usage is missing (#8193)
* fix(gemini): bill audio inlineData by length, not as images, when usage is missing

When upstream reported no completion tokens (no usageMetadata, or
prompt-only usageMetadata), every inlineData part with a non-empty
mimeType was counted as an image and backfilled with 1400 completion
tokens. A relay that answered a text request with thousands of
audio/l16 TTS chunks was billed millions of output tokens.

Estimate inline output from the payload instead, on the stream and
non-stream paths alike:
- image* parts (case-insensitive) keep the 1400-token estimate;
- PCM audio (audio/l16 or audio/pcm with a rate) counts 25 tokens per
  second, Gemini's audio token rate, measured from the decoded byte
  count of valid base64 holding whole 16-bit samples, and is recorded
  as audio output so tiered expressions price it with ao; on the
  prompt-only path it replaces any upstream AUDIO candidate entry;
- audio without a measurable length and other media add nothing.

Responses that report completion tokens are unchanged.

* fix(gemini): harden inline media usage fallback and avoid redundant scan

- Parse inlineData MIME types once with mime.ParseMediaType and ignore empty image payloads
- Gate BillingUsage AUDIO detail replacement on inline fallback application so stale AUDIO entries are cleared when estimating images
- Defer inline media observation in buildUsageFromGeminiResponse until completion tokens are missing
- Saturate audio token conversion inside audioTokens via common.QuotaFromFloat without bare int casts
- Add regression cases for empty image payloads, stale AUDIO clearing on image fallback, and preserving upstream completion counts

---------

Co-authored-by: seefs001 <i@seefs.me>
2026-11-27 19:12:07 +08:00
5f8525d83c fix(claude): map output_tokens_details.thinking_tokens to reasoning_tokens (#8431)
* fix(claude): map output_tokens_details.thinking_tokens to reasoning_tokens

Anthropic reports thinking tokens in usage.output_tokens_details.thinking_tokens,
a subset of output_tokens. ClaudeUsage had no such field, so OpenAI-format
responses converted from a Claude channel always reported
completion_tokens_details.reasoning_tokens = 0.

Decode the field and carry it into CompletionTokenDetails.ReasoningTokens for
non-stream responses and stream message_start/message_delta usage, bounded by
output_tokens. completion_tokens and billing are unchanged.

* fix(claude): apply reported zero thinking_tokens on message_delta

message_delta usage is cumulative. When output_tokens_details is present, use its thinking_tokens even if zero; keep the earlier count only when the breakdown is absent.

* fix(claude): bound delta thinking_tokens by merged output and preserve on merge

- Clamp message_delta thinking_tokens against accumulated completion_tokens so deltas omitting output_tokens do not zero out reasoning_tokens.
- Copy incoming OutputTokensDetails in MergeClaudeUsageNonZero to preserve or replace the breakdown across usage merges.

---------

Co-authored-by: forgottener <8578113+forgottener@users.noreply.github.com>
Co-authored-by: seefs001 <i@seefs.me>
2026-11-27 19:11:48 +08:00
Seefs 00056f5db7 Merge commit from fork
* fix(auth): enforce exact email matching and stored address on password reset

Enforce exact normalized email comparison in Go in GetUniqueUserByEmail (and FillUserByEmail) without premature SQL LIMIT 2, preventing accent-insensitive database collations from matching look-alike email addresses.

Send password reset emails, key reset codes, and build query-escaped reset URLs strictly using the stored normalized user email, revoking generated codes if delivery fails. Atomically verify and consume reset tokens in constant time via common.ConsumeCodeWithKey to prevent replay, and decode the reset payload via common.DecodeJson.

Add regression tests covering look-alike email rejection, stored-email delivery, single-use token enforcement, failed delivery cleanup, and token expiry (OWASP ASVS v4.0.3 2.5.1/2.5.2/2.5.3/2.5.6).

* fix(auth): preserve reset recipients and enforce exact email lookup at login
2026-11-27 19:11:25 +08:00
Nick Old fde819b05a fix(groups): 匿名请求公开分组接口时跳过用户分组查询 (#8461) (#8463) 2026-11-27 18:13:13 +08:00
Calcium-Ion 81c1fd20ef fix(models): 打开排序弹窗时再读取系统选项 (#8454)
* fix(models): 打开排序弹窗时再读取系统选项

* fix(models): 读取已保存排序后再启用编辑
2026-11-26 13:51:26 +08:00
CaIon c27abf3626 feat(pricing): 模型广场支持推荐顺序和按用量排序
- 模型广场的排序新增「推荐」「请求最多」「Token 最多」,默认按推荐排序;未设置时与原来的按名称排序一致
- 模型管理新增「模型广场排序」,可选手动排序、使用最多、置顶 + 使用最多,按请求数或 Token 统计近 1/7/30 天用量
- 公开的定价接口只返回排序结果,不返回各模型的用量
2026-11-26 00:29:07 +08:00
CaIon def76a60d6 feat(plugins): 放宽插件响应和 JSON 克隆的大小限制 2026-11-26 00:01:58 +08:00
dependabot[bot] 6627f0e3f3 chore(deps): bump go.opentelemetry.io/otel/trace from 1.41.0 to 1.47.0 (#8326)
Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.41.0 to 1.47.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.41.0...v1.47.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/trace
  dependency-version: 1.47.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-24 18:31:03 +08:00
feeeeiandseefs001 c53dcf3356 fix(relaykit): report cached tokens in Gemini usageMetadata built from chat usage (#8333)
* fix(relaykit): report cached tokens in Gemini usageMetadata built from chat usage

Gemini promptTokenCount includes cached content, but responses converted
from chat usage (e.g. a Claude channel serving a Gemini-format request)
always reported cachedContentTokenCount as 0 while billing_usage carried
the cache read. Fill cachedContentTokenCount from the chat usage cache-read
count in the non-stream, stream chunk, and stream state converters.

* fix(relaykit): ignore non-positive cached token counts for Gemini usage

---------

Co-authored-by: seefs001 <i@seefs.me>
2026-11-24 17:46:04 +08:00
CaIon cb074d31e2 fix(pricing): 按阶梯展示价格同步中的上游表达式 2026-11-24 01:13:20 +08:00
CaIon ede88eb1cc feat(plugins): 支持批量更新已安装的市场插件
按当前市场源核对版本和源码哈希,逐项执行升级,并汇总成功、失败和跳过的插件。

Closes #8413
2026-11-24 00:55:16 +08:00
Rinvay.H 51a1ceeaec 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
2026-11-23 03:22:21 +08:00
Seefs 1a395c76a9 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.
2026-11-23 02:47:17 +08:00
CaIon 185e1e51a0 chore(deps): 升级 moego 至 v0.1.0-alpha.5 并统一正则库 relaykit/v0.3.8 2026-11-22 21:52:10 +08:00
CaIon 8542c9d649 fix(pricing): 修复模型广场显示私有分组的问题
按访问者的可用分组过滤模型标签、性能明细和汇总。管理员后台通过独立接口读取全站性能数据。
2026-11-21 02:30:29 +08:00
feitianbubu ac1330c5c8 feat(kling): map sizes to the 4:3 and 3:4 aspect ratios of kling-4.0 (#8348) 2026-11-21 02:15:50 +08:00
Seefs a85f7e844d 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
2026-11-21 01:25:05 +08:00
Sky 48f9df96ea fix(task): 修复私有渠道的任务媒体下载 (#8199)
* fix(task): allow media downloads from the task channel origin

* fix(task): recognize default ports on IPv6 media origins
2026-11-20 16:42:10 +08:00
Sky 5cc159213b 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
2026-11-20 16:41:53 +08:00
Sky 4407b8470f fix(task): keep polling nonterminal tasks at full progress (#8201) 2026-11-20 16:04:28 +08:00
Adam.Diu 329e899ebe fix: 修复图片任务插件参数覆盖并补充百炼回归测试 (#8027)
* fix: 修复图片任务插件参数覆盖并补充百炼回归测试

* fix(task): isolate channel headers and track retry attempts
2026-11-20 15:53:01 +08:00
CaIon b2d12187a0 perf(relay): parallelize image compression with moego WebP 2026-11-20 14:59:44 +08:00
RedwindA 3a407cc9b0 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
2026-11-18 18:21:39 +08:00
Seefs a1d1fb0cca docs(security): clarify scope for root-published site content (#8384) 2026-11-18 15:20:50 +08:00
Seefs 58f786fbfe docs(security): document expected access to Midjourney images (#8383) 2026-11-18 15:08:03 +08:00
feitianbubu 3546e93827 fix(relay): apply GPT-6 chat parameter rules to gpt-6.2-astra and gpt-6.2-sol (#8375) 2026-11-18 14:19:03 +08:00
Seefs 669d774976 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
2026-11-17 14:44:49 +08:00
翅膀喵 e8c6a5d953 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.
2026-11-17 14:35:16 +08:00
CaIon bb30732b83 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.
2026-11-17 13:51:40 +08:00