lcy
1d640c40e5
fix(tools): 清洗工具 Schema 里非法的 null required,修复上游 400
...
JSON Schema 规定 required 必须是属性名数组,但部分客户端会发成 null,
严格校验的上游直接拒绝整个请求:
xAI 400 /required: null is not of type "array"
Moonshot 400 At path 'required': required must be an array
同样的模型发纯文本请求一切正常,只有带 tools 时才失败,因此表现得像模型
或渠道故障。
三处改动:
1. 清洗 required:null 时整键删除,而不是替换成 []。JSON Schema 里缺省
required 等价于无必填项,删除保留了客户端原意,置 [] 反而凭空造出一条
客户端从未声明的约束。
2. 把 input_schema 也识别为 schema 根。此前只认 OpenAI Responses 的
parameters 拼法,Anthropic Messages 的工具定义因此绕过整套清洗。
3. 在 ForwardAsAnthropic 入口调用清洗。/v1/messages 此前不做任何工具
Schema 处理;该函数会分流到原生 Anthropic 直通、Chat Completions 与
Responses 三条路径,每条都原样透传 tools,所以必须在分流之前处理。
另外把 contentSchema 补进子 schema 关键字:它承载嵌套 schema,其中的
null required 此前会漏网。
配套测试同时锁定反向保证:default / examples / const / enum 里装的是实例
数据,字面量 {"required": null} 属于客户端 payload,不能被改写。现有的
关键字白名单下降本就如此,测试用于防止它退化成无差别遍历。
2026-09-22 20:49:24 +08:00
Wesley Liddick
738ef1c73c
Merge pull request #7442 from wucm667/fix/issue-7436-image-balance-error
...
fix(images): preserve insufficient balance failures
2026-09-22 20:27:23 +08:00
Wesley Liddick
680a992fc9
Merge pull request #7426 from xlplbo/fix/openai-codex-turn-metadata-ascii
...
fix(openai): 改写 Codex turn metadata 时保留非 ASCII 转义
2026-09-22 20:25:47 +08:00
Wesley Liddick
1716e99151
Merge pull request #7466 from nagi330/add_grok4-7_support-0922
...
feat(grok):add grok 4.7 support
2026-09-22 18:13:37 +08:00
Wesley Liddick
483cd56924
Merge pull request #7361 from wucm667/feat/issue-7357-optional-default-groups
...
feat(simple): make startup default group creation optional
2026-09-22 18:13:18 +08:00
Wesley Liddick
b6c6f1add5
Merge pull request #7473 from lzfxxx/fix/codex-manifest-opencode-go
...
fix(codex): include OpenCode Go in model capability resolution
2026-09-22 18:13:00 +08:00
Wesley Liddick
3442a6a53e
Merge pull request #7432 from doublepi123/fix/antigravity-compat-bare-gemini-model
...
fix(antigravity): 裸 Gemini 模型名在所有转发入口解析到思考变体,修复 404/502
2026-09-22 18:12:34 +08:00
Wesley Liddick
9d9e90960e
Merge pull request #7448 from feeeei/fix/gemini-transport-error-failover
...
fix(gemini): 传输层错误转 failover,不再同账号退避重试
2026-09-22 18:12:19 +08:00
Wesley Liddick
fcd07ba0af
Merge pull request #7475 from Pluviobyte/codex/fix-proxy-restore-probe
...
fix(proxies): invalidate billing probe on fallback restore
2026-09-22 18:12:04 +08:00
Wesley Liddick
405727805a
Merge pull request #7477 from Pluviobyte/codex/fix-subscription-reduction-remainder
...
fix(subscriptions): preserve partial days during redemption deductions
2026-09-22 18:11:46 +08:00
Wesley Liddick
a46493724b
Merge pull request #7476 from Pluviobyte/codex/fix-subscription-reduction-lock
...
fix(subscriptions): lock negative redemption updates
2026-09-22 18:11:11 +08:00
spongehah
7fbc59eb69
fix: 选号读取分组时不再聚合账号数
...
- 推理选号只需要隐私开关和分组名,改为 GetByIDLite
- 避免 GetByID 附带的账号计数聚合打满主库
- 管理列表的实时账号数统计保持不变
2026-09-22 16:54:36 +08:00
Rain
0c0df031c5
fix(subscriptions): preserve partial days during redemption deductions
2026-09-22 15:03:06 +08:00
Rain
85ed17b313
fix(subscriptions): lock negative redemption updates
2026-09-22 15:03:05 +08:00
Rain
b754ff6f1b
fix(proxies): invalidate billing probe on fallback restore
2026-09-22 14:51:44 +08:00
Zhaofeng Li
e35123b8ac
fix(codex): include OpenCode Go in model capability resolution
2026-09-22 14:50:29 +08:00
nagi330
935db68517
feat(grok):add grok 4.7 support
2026-09-22 10:30:01 +08:00
Wesley Liddick
1c0a69c0ce
Merge pull request #7412 from StarryKira/codex/custom-reasoning-effort-billing
...
feat: 支持自定义思考等级倍率计费
2026-09-21 22:55:17 +08:00
lcy
27f4398b50
fix(antigravity): 裸 Gemini 模型名在所有转发入口解析到思考变体
...
#7258 引入的 resolveGeminiThinkingVariant 只接到了 ForwardGemini,
因此仅覆盖 /v1beta 原生 Gemini 路径。经 /v1/chat/completions 与
/v1/messages 进来的请求直接调用 getMappedModel,裸名被原样透传;
Antigravity 目录只登记 -low/-medium/-high/-tiered 变体,这些请求
仍然以 404 "Requested entity was not found." 失败。
把解析下沉到 getMappedModel(新增 getMappedModelForThinkingLevel),
一次覆盖四个调用点:/v1beta 原生、/v1/chat/completions、/v1/messages
以及后台账号连接测试。各转发入口按自身协议推导档位——原生读
generationConfig.thinkingConfig,Claude 侧读 thinking.budget_tokens,
两者阈值一致;默认入口按 high 兜底。
mapAntigravityModel 保持不变,调度侧的模型支持判定语义不受影响。
2026-09-21 20:13:44 +08:00
haruka
e47255715d
fix(billing): preserve final reasoning effort across forwarding paths
2026-09-21 19:58:02 +08:00
feeeei
d0ed0eacac
fix(gemini): 传输层错误转 failover,不再同账号退避重试
...
上游 Do 返回非 HTTP 错误(代理/DNS/TCP/TLS/响应头超时)时,Gemini 三条转发路径
(ForwardNative / Forward / ForwardAsChatCompletions)原先在同一账号上重试 5 次,
退避 1+2+4+8≈15s(time.Sleep 不感知 ctx),耗尽后直接向客户端写 502 且不换号:
单账号链路故障期间 TTFT 被整段拖高,同组健康账号闲置。
对齐 Anthropic/Bedrock 侧 handleUpstreamTransportError 的既有语义:
- 传输层错误单次尝试后即返回 *UpstreamFailoverError(502),由 handler failover
循环换号,耗尽后才按端点格式渲染错误;service 不再写响应
- 持久性故障(connection refused/no route/DNS not found/代理认证失败)额外临时
摘除账号 10 分钟;瞬时故障(EOF/reset/超时)只换号不摘号
- context.Canceled 保持原样返回:不换号也不摘账号
- countTokens 传输失败时立即本地估算兜底,不换号
- 摘号实现抽为 tempUnscheduleAccountForTransportError 供两侧共用,日志事件名不变
HTTP 状态码(429/5xx)的服务内重试环未改动。
2026-09-21 14:13:57 +08:00
wucm667
de98bdff1e
fix(images): preserve insufficient balance failures
2026-09-21 10:23:10 +08:00
xlplbo
763443abf2
fix(openai): 改写 Codex turn metadata 时保留非 ASCII 转义
2026-09-20 19:27:47 +08:00
haruka
b8d52fad34
feat(billing): support configurable reasoning effort multipliers
2026-09-20 16:41:49 +08:00
shaw
d2e319b2a1
test: 修复 WebSocket 同线程抢占测试的关闭时序竞态
2026-09-20 16:37:07 +08:00
Wesley Liddick
acdf3c54da
Merge pull request #7401 from StarryKira/codex/codex-credits-referrals-upstream
...
feat(openai): display Codex credits and support referral invitations
2026-09-20 16:00:28 +08:00
haruka
fc96132e72
fix(openai): harden referral outcomes and isolate HTTP transport
2026-09-20 15:47:53 +08:00
haruka
8f6bbb59c7
test: stabilize Gemini keepalive test
2026-09-20 15:04:15 +08:00
shaw
e009ea3036
fix(upstream): 恢复 OpenAI HTTP/2 保活容错期限
2026-09-20 14:46:25 +08:00
haruka
5090ffe05e
feat(openai): show Codex credits and manage referral invitations
2026-09-20 14:38:29 +08:00
Wesley Liddick
bbdcfbac0a
Merge pull request #7304 from wucm667/fix/issue-7298-response-model-alias
...
fix(gateway): restore public response model aliases
2026-09-20 14:07:16 +08:00
Wesley Liddick
7403a01177
Merge pull request #7314 from wucm667/fix/issue-7306-keyword-reminder-bypass
...
fix(moderation): prevent reminder tags from bypassing keyword checks
2026-09-20 14:07:04 +08:00
Wesley Liddick
53b4bbe736
Merge pull request #7349 from wucm667/fix/issue-7348-preserve-client-version
...
fix(settings): preserve client version on invalid user agent
2026-09-20 14:06:48 +08:00
Wesley Liddick
8bb48622a3
Merge pull request #7362 from wucm667/fix/issue-7358-preserve-account-errors
...
fix(accounts): preserve refresh errors during usage queries
2026-09-20 14:06:36 +08:00
Wesley Liddick
f28adb6ddb
Merge pull request #7387 from Brisbanehuang/codex/upstream-content-audit-typesafe
...
feat: 内容审计接入 TypeSafe AI,支持双引擎切换与独立配置
2026-09-20 13:47:14 +08:00
shaw
29eead917f
feat(pluginapi): HostService 账号目录返回结构化只读元数据
...
纯宿主侧改动,向后兼容。
- 契约(pkg/pluginapi/v1/plugin.proto,已重新生成):ListAccounts 增补
repeated AccountInfo accounts(保留 account_ids 向后兼容),新增 metadata_json
只读快照字段。HostServiceAPIVersion 1→2(InitHostServices 运行时协商,加法式,
旧调用方忽略新字段即可)。
- 权限边界:可见范围由清单能力经 pluginCapabilityAccountScopeGrants 推导,
ListAccounts 与 ResolveOutboundIdentity 均以该范围为权威边界。
- metadata_json 采用 denylist:剥离 Credentials 与含反向引用的关联对象
Groups/AccountGroups(避免 encoding/json 循环引用),其余字段自动透传,
数据模型新增非机密字段无需改宿主。
测试:范围/元数据/无凭据泄漏用例、denylist 反射护栏 + 循环引用安全断言、纵深过滤用例;
build/vet/gofmt、-tags unit 与 -race 全绿。
2026-09-20 11:26:19 +08:00
Brisbanehuang
1bfe0d3728
fix: sync draft audit key status and threshold defaults
2026-09-19 20:52:31 -04:00
Brisbanehuang
783a0a9830
feat(content-audit): add independent TypeSafe engine profiles
2026-09-19 20:52:31 -04:00
wucm667
b252821c59
fix(accounts): preserve refresh errors during usage queries
2026-09-19 17:22:39 +08:00
wucm667
68aa26477f
feat(simple): make startup default group creation optional
2026-09-19 16:47:17 +08:00
Wesley Liddick
aea725f2ea
Merge pull request #7247 from Qiaogun/codex/seedance-native-api
...
feat: 支持 Seedance / Ark 原生视频任务 API
2026-09-19 12:11:17 +08:00
Wesley Liddick
74431ffad8
Merge pull request #7258 from HuntercodeT/fix/antigravity-gemini-bare-model-thinking-variant
...
fix(antigravity): Gemini 原生请求的裸模型名按 thinkingConfig 解析到 -low/-medium/-high 变体
2026-09-19 12:01:22 +08:00
Wesley Liddick
0c9e83b59c
Merge pull request #7278 from HuntercodeT/fix/antigravity-gemini-sse-comment-keepalive
...
fix(antigravity): Gemini 原生流对 go-genai / python-genai 客户端不发 SSE 注释心跳
2026-09-19 12:00:18 +08:00
Wesley Liddick
1b45d21328
Merge pull request #7340 from ye4241/fix/kimi-cn-quota-403-rate-limit-pause
...
fix(ratelimit): CN coding-plan 账号配额耗尽的 403 按限流暂停调度,而非永久禁用
2026-09-19 11:59:21 +08:00
Wesley Liddick
d5cea617a5
Merge pull request #7345 from laoxiechuzheng/fix/anthropic-root-union-schema
...
fix(apicompat): 摊平 Responses→Anthropic 工具 schema 顶层联合,修复 Codex 内置工具导致的 400
2026-09-19 11:59:00 +08:00
Wesley Liddick
4275047d16
Merge pull request #7313 from baryon/contrib/deepseek-chat-reasoning-content
...
fix(openai): pass DeepSeek thinking-mode reasoning_content on chat fallback
2026-09-19 11:57:55 +08:00
shaw
6477143533
test(plugin): check type assertions to satisfy errcheck lint
2026-09-19 11:47:14 +08:00
shaw
c63bd14a02
feat(plugin): generic host services + read-only status bridge channel
...
Extend the local plugin system's host<->plugin contract with generic,
capability-neutral facilities, so transport plugins can be built on top
without embedding plugin-specific logic in the host.
Host services (plugin dials a broker-provided HostService gRPC):
- per-plugin namespaced KV store (key/value size and TTL bounded)
- account directory: ListAccounts + ResolveOutboundIdentity, restricted to
the accounts a plugin's declared capability already covers
- InitHostServices lifecycle hook; plugins that don't implement it run
unchanged and are simply offered no host services
Read-only runtime status channel:
- HealthResponse gains an opaque, plugin-defined status_json produced
passively (no config apply, no upstream call, no side effects)
- GET /admin/plugins/:id/status (ungated) and the plugin.status UI-bridge
verb map to Health, so a status UI can poll live state without a step-up
prompt or a "test" side effect
- config.test no longer force-shows a host success toast; the plugin UI owns
result presentation, so plugins that read status do not spam toasts
Document the UI-bridge verb taxonomy (read vs mutate/test gating) and the
status contract under pkg/pluginapi.
2026-09-19 11:25:56 +08:00
wucm667
2d37088bd9
fix(settings): preserve client version on invalid user agent
2026-09-19 10:36:51 +08:00
laoxiechuzheng
a8a1a3a958
fix(apicompat): flatten root union tool schemas for Anthropic
...
Codex 会把 codex_app 等内置工具的 parameters 根节点声明成对象分支的 oneOf/anyOf,Anthropic 拒绝工具 input_schema 顶层的 oneOf/anyOf/allOf,导致 /v1/responses -> /v1/messages 直接 400。
Responses->Anthropic 转换时摊平顶层联合:属性取各分支并集,同名属性用嵌套联合保留两侧约束,required 在 oneOf/anyOf 下取分支交集、allOf 下取并集;嵌套联合保持不变。
2026-09-19 07:34:21 +08:00