3557 Commits

Author SHA1 Message Date
wucm667
827764d7bd fix(account): preserve combined model restrictions 2026-05-14 15:00:28 +08:00
wucm667
041d138f76 fix(gateway): route Gemini chat completions upstream 2026-05-14 11:48:00 +08:00
wucm667
862819042c feat(openai): 支持后台配置 Responses API 路由 2026-05-14 11:46:24 +08:00
wucm667
61b6272110 fix(payment): apply product affix to subscriptions 2026-05-14 11:36:02 +08:00
wucm667
a5acefcc9e fix(install): 检查 Bash 版本并提示升级 2026-05-14 11:35:07 +08:00
wucm667
4d51e53d20 fix(redeem): 修复批量复制兑换码兼容性 2026-05-14 11:35:00 +08:00
astr0-g
be15a3e6ce fix passthought 首token时间计算修复 2026-05-13 18:01:09 -07:00
wucm667
679c0865a0 fix(openai): handle versioned compatible base URLs 2026-05-13 11:25:15 +08:00
gaoren002
32a79be962 fix(openai): add codex auto review model pricing 2026-05-12 09:26:53 +00:00
2ue
115535e1d5 Update unit tests for image size resolver 2026-05-12 16:12:08 +08:00
2ue
4840194b18 Fix lint issues in image billing change 2026-05-12 16:04:24 +08:00
2ue
bb4c1abe28 Fix image billing size normalization 2026-05-12 15:21:31 +08:00
shaw
18790386a7 fix(deploy): 移除数据库与 Redis 宿主机端口映射 2026-05-12 15:16:39 +08:00
imlewc
224e9fc6c2 fix(auth): prefer OIDC compat email in pending flow 2026-05-12 14:35:20 +08:00
hoobnn
4467922199 fix: add autocomplete="one-time-code" for TOTP autofill support
Add a hidden input with autocomplete="one-time-code" so password managers
(1Password, Bitwarden, Chrome, Apple Keychain) can detect and auto-fill
TOTP verification codes during 2FA login.
2026-05-12 13:54:41 +08:00
github-actions[bot]
62ccd0ff39 chore: sync VERSION to 0.1.126 [skip ci] 2026-05-11 15:30:51 +00:00
Wesley Liddick
3d7e7b78cf
Merge pull request #2356 from jack-atlas/fix/openai-messages-multi-tool-continuation
Preserve multi-tool context in OpenAI messages continuation
2026-05-11 23:03:24 +08:00
shaw
ea751f6515 test: update admin settings contract for Antigravity UA 2026-05-11 22:55:02 +08:00
Wesley Liddick
ca17c364e5
Merge pull request #2319 from wucm667/codex/fix-openai-unpriced-usage-log
fix(openai): record zero-cost usage for unpriced models
2026-05-11 22:45:17 +08:00
Wesley Liddick
ac91de8592
Merge pull request #2353 from XiaoYu994/fix/openai-429-plan-type-sync
fix: sync OpenAI plan type from usage limit errors
2026-05-11 22:28:13 +08:00
shaw
a07a0dac63 feat: add configurable Antigravity user agent version 2026-05-11 22:25:20 +08:00
shaw
9377c96746 fix: 让消息 cache_control 改写默认关闭 2026-05-11 21:26:41 +08:00
shaw
297b54d066 fix: 完善工具名改写测试和格式 2026-05-11 17:27:04 +08:00
Wesley Liddick
1088e27cd1
Merge pull request #2340 from iFwu/fix/mimic-rewrite-tool-use-in-messages
fix(mimic): rewrite tool_use names in messages to match renamed tools
2026-05-11 16:53:00 +08:00
XiaoYu994
c3a1471775 fix: sync OpenAI plan type from usage limit errors 2026-05-11 16:22:40 +08:00
Wesley Liddick
1e2f55078c
Merge pull request #2289 from wucm667/fix/ccswitch-import-model
fix(ccswitch): 修复 Codex 导入缺少模型参数
2026-05-11 16:12:47 +08:00
Wesley Liddick
348eeaa06a
Merge pull request #2297 from ZeroDeng01/dev
fix(gemini): 修复 Gemini Vertex Service Account 账号测试时,前置 OAuth token 请求没有使用账号代理的问题
2026-05-11 16:12:20 +08:00
Wesley Liddick
f19421b16e
Merge pull request #2247 from anzhen-tech/codex/fix-ws-replay-function-call-output
fix: preserve replay tool output continuation
2026-05-11 16:11:37 +08:00
shaw
18cc4691e6 优化系统设置页标签导航 2026-05-11 16:10:40 +08:00
Jack
87d73236f2 Preserve multi-tool context in OpenAI messages continuation
Claude Code can send one assistant turn with multiple tool_use blocks followed by a user turn containing matching tool_result blocks. The OpenAI /v1/messages compatibility path trimmed continuation input to the last user turn plus adjacent tool outputs, which could leave a function_call_output without its earlier function_call when previous_response_id was attached.

This keeps all function_call items needed by retained function_call_output entries so the upstream Responses API can resolve every call_id.

Constraint: Applies only to the OpenAI /v1/messages -> Responses compatibility continuation path.

Rejected: Disable previous_response_id for all tool outputs | loses continuation and cache benefits for valid turns.

Confidence: high

Scope-risk: narrow

Directive: Do not trim function_call_output entries without preserving their matching function_call call_id context.

Tested: go test ./internal/service -run 'TestForwardAsAnthropic_(PreviousResponseIDKeepsMultiToolCallContext|AttachesPreviousResponseIDForCompatContinuation|OAuthPreservesClaudeCodeToolCallID)' -count=1

Tested: go test ./internal/service -run 'TestForwardAsAnthropic|TestApplyAnthropicCompatFullReplayGuard|TestOpenAICompat|Test.*ToolContinuation' -count=1

Tested: go test ./internal/pkg/apicompat -count=1

Related: #2337
2026-05-11 12:03:17 +08:00
ZeroDeng
37ec21e1a5
Merge branch 'main' into dev 2026-05-11 11:48:55 +08:00
ZeroDeng
f788e6bdba fix(service): handle unexpected default transport type, simplify warning append 2026-05-11 11:43:44 +08:00
Wesley Liddick
8b0b507a95
Merge pull request #2314 from dexcoder6/fix/payment-result-nan
Fix/payment result nan
2026-05-11 11:24:46 +08:00
shaw
b23055af5b feat: add Airwallex payments and multi-currency support 2026-05-11 11:17:26 +08:00
iFwu
f97b853460 fix(mimic): rewrite tool_use names in messages to match renamed tools
The Claude Code mimic path rewrites tool names in tools[] (and
tool_choice) but left tool_use blocks in messages[] with their
original names. Anthropic validates that every tool referenced by
a tool_use block is declared in tools[], so the mismatch produces:

    messages.N.content.M: Input tag 'original_name' not found in tools

(surfaced as HTTP 400 directly, or wrapped as 424 by upstream proxies
such as Bedrock gateways.)

The previous code comment asserted 'this matches Parrot; response-side
bytes.Replace will restore the names'. Parrot's behavior is fine for
Claude Code's own tool set, but breaks once the upstream client sends
additional tools (e.g. web_search) that are not part of Claude Code
and therefore get renamed here.

Fix: apply the same ToolNameRewrite to messages[].content[] blocks
where type == 'tool_use', keeping tools[], tool_choice and messages
self-consistent before the request reaches Anthropic. tool_result
blocks reference tools via tool_use_id, not name, so no change is
needed there.

A new unit test covers the full rewrite flow and guards against
server tools (type != '') being affected.
2026-05-10 18:01:19 +08:00
wucm667
6d69ae87c3 fix(openai): record zero-cost usage for unpriced models 2026-05-09 17:33:35 +08:00
dexcoder6
ba1c6fa5fd fix: 修复管理端订单详情充值金额显示 NaN
与支付成功页同源问题:fee_rate=0 时后端 omitempty 剔除字段,前端
`fee_rate <= 0` 判断对 undefined 失效,进入除法分支得到 NaN。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 13:47:57 +08:00
dexcoder6
6884b03e59 fix: 修复支付成功页充值金额显示 NaN
后端 ent 模型 PaymentOrder.FeeRate 带 omitempty,fee_rate=0 的订单
在 JSON 序列化时该字段会被剔除。前端 baseAmount 计算用 `fee_rate <= 0`
判断走分支,但 `undefined <= 0` 为 false,因此进入除法分支得到 NaN。

将 fee_rate 通过 Number(...) || 0 归一化,使缺失字段等价于 0。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 13:45:49 +08:00
shaw
dbc8ae658c chore: update sponsors 2026-05-08 20:00:06 +08:00
wucm667
65493df95a fix(ccswitch): add codex model to import deeplink 2026-05-08 17:31:36 +08:00
shaw
33db04fb75 chore: 修复 CI 安全与 lint 检查 2026-05-08 14:42:20 +08:00
ZeroDeng
2a17c0b229 fix(gemini): route Vertex token exchange through account proxy 2026-05-08 14:03:15 +08:00
shaw
fda1ed459d feat: 优化 OAuth 账号导入流程 2026-05-08 11:36:09 +08:00
haruka
0f8e2d0934 fix(security): 屏蔽 admin 账号接口返回的敏感凭证字段
Account.Credentials 是 JSONB map,混合存放可编辑的非敏感配置(base_url、
model_mapping、project_id 等)与敏感秘钥(OAuth access/refresh/id token、
API key、AWS secret、Vertex private key 等)。当前所有 admin 账号接口直接
透传该 map,token 经由浏览器 DevTools、抓包、日志等途径泄漏。

- service 包新增 SensitiveCredentialKeys 清单与 MergePreservingSensitiveCreds
  作为单一权威定义。
- dto 层 RedactCredentials 在响应里剥离敏感子键,输出 credentials_status
  (has_<key> 布尔标识)告知前端存在性,不暴露原值。
- AccountFromServiceShallow 接入脱敏,覆盖 list、get、create、update、
  refresh、batch、bulk-update、OAuth 创建等 9 个 handler。
- service.UpdateAccount 改为合并语义:incoming 没传敏感键则保留 existing,
  让前端"全对象 PUT"流程在脱敏后无感工作;显式提供新 token 仍会覆盖。
- 前端 EditAccountModal 修复脱敏后会崩的两处兜底:apikey 必填检查和
  Vertex SA JSON 存在性校验改读 credentials_status.has_*。
- 导出端点 /admin/accounts/data 走独立的 DataAccount 结构,按设计保留
  完整 credentials 作为管理员备份路径。

测试:RedactCredentials 单元测试、mapper 端到端 JSON 断言(确认序列化
后无 token 子串)、UpdateAccount 合并语义三种场景(保留 / 覆盖 / 空 map 跳过)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 03:44:04 +08:00
github-actions[bot]
a466e80ed6 chore: sync VERSION to 0.1.125 [skip ci] 2026-05-07 11:42:30 +00:00
shaw
8a835b22bb ci: fix lint and test failures 2026-05-07 19:26:18 +08:00
shaw
57fd7998d3 fix(gateway): stop default redact thinking beta injection 2026-05-07 18:56:11 +08:00
shaw
e872cbec0b feat: 添加登录注册条款确认 2026-05-07 17:35:05 +08:00
shaw
6681aee98d 更新账号模型白名单 2026-05-07 15:11:38 +08:00
anzhen-tech
16a315574d fix(openai): preserve replay tool output continuation 2026-05-07 14:59:42 +08:00