3518 Commits

Author SHA1 Message Date
Wesley Liddick
c65522641d
Merge pull request #2473 from is7Qin/fix/image-tier-validation
fix(channels): 按次/图片计费模式下区间校验跳过 token 上下文重叠规则
2026-05-19 14:28:33 +08:00
Wesley Liddick
57603e169e
Merge pull request #2461 from wucm667/fix/image-gen-upstream-context-detach
fix(gateway): 修复图片生成上游请求过早取消
2026-05-19 14:14:50 +08:00
Wesley Liddick
082216befc
Merge pull request #2508 from honue/main
fix: 修复管理后台分组页可用账号数显示错误
2026-05-19 14:08:00 +08:00
Wesley Liddick
be0c857240
Merge pull request #2502 from yangzc2004-bit/codex/gemini-google-one-429-cooldown
fix: use tier cooldown for google one gemini 429
2026-05-19 14:07:25 +08:00
Wesley Liddick
a340002c6d
Merge pull request #2401 from 2ue/fix/normalize-image-billing-size
修复图片计费尺寸归一化与使用记录展示
2026-05-19 14:00:24 +08:00
name
0ad69d1ffb Merge branch 'main' into fix/openai-token-missing-refresh-disable 2026-05-19 11:06:19 +08:00
name
ddab7de916 Merge branch 'main' into fix/image-tier-validation 2026-05-19 11:06:17 +08:00
name
d70497a669 Merge branch 'main' into feat/available-channels-default-pricing 2026-05-19 11:06:15 +08:00
Wesley Liddick
14f54be03f
Merge pull request #2481 from weak-fox/lyp/fix-issue-2223-capacity-retry
fix: 修复 OpenAI 模型容量错误未进入自动重试
2026-05-19 10:24:18 +08:00
Wesley Liddick
8584b8f7cf
Merge pull request #2504 from yetone/fix-admin-settings-darkmode
fix(admin/settings): make tab shell readable in dark mode
2026-05-19 09:55:01 +08:00
Wesley Liddick
f9fec78b70
Merge pull request #2505 from is7Qin/fix/openai-compat-usage-parsing
修复 Claude 映射 GPT 后被记为 0 token 的计费漏洞
2026-05-19 09:53:50 +08:00
shaw
a729752de6 test: align codex tool-call id assertions with fc_ prefix 2026-05-19 09:45:05 +08:00
Wesley Liddick
11870cf84f
Merge pull request #2499 from yetone/fix/codex-transform-fc-underscore
fix(codex-transform): preserve underscore when rewriting `call_*` tool-call ids
2026-05-19 09:39:25 +08:00
Wesley Liddick
2c3b6e4a31
Merge pull request #2527 from wucm667/fix/docker-pnpm-ignored-builds
fix(docker): 固定前端构建阶段 pnpm 版本为 v9
2026-05-19 09:30:10 +08:00
Wesley Liddick
e318376e88
Merge pull request #2548 from Arron196/fix/sla-exclude-capacity-errors
fix: 统一 Ops SLA 与请求错误统计口径
2026-05-19 09:29:22 +08:00
Wesley Liddick
d1910751b6
Merge pull request #2541 from DanisJiang/fix/alipay-pagepay-qrcode
fix(payment): 修复支付宝官方扫码二维码生成错误
2026-05-19 09:24:23 +08:00
benjamin
f1cc83e0ee fix(admin): 修正管理端日卡额度提示
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
a66f771cb1 fix(frontend): 修正用户端日卡额度提示
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
0b40470597 i18n: 增加日卡额度结束文案
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
af6cdfabcc feat(frontend): 增加订阅配额时间判断工具
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
a4884b4e75 fix(subscription): 将日卡改为一次性每日配额
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
Wesley Liddick
1d78dde8c4
Merge pull request #2552 from lyen1688/fix/anthropic-passthrough-keepalive
fix: 修复 Anthropic API Key 透传流式保活
2026-05-18 20:13:41 +08:00
benjamin
5713820813 feat: add upstream model sync controls
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:55 +08:00
benjamin
3b4eccdd5d feat: add upstream model sync frontend API
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:44 +08:00
benjamin
36c00374d3 feat: expose upstream model sync admin API
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:33 +08:00
benjamin
b9ecf25207 fix: harden Antigravity model list requests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:23 +08:00
benjamin
ba676e43fd feat: add upstream model sync service
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:12 +08:00
lyen1688
164e2f610c fix: add keepalive for Anthropic passthrough streams 2026-05-18 18:41:25 +08:00
benjamin
5dae745e86 test: 避免 Ops 图表测试使用保留组件名
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 17:12:41 +08:00
benjamin
924e10831a fix: 更新 Ops 错误分布口径文案
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:53:16 +08:00
benjamin
09cec311e8 fix: 统一 Ops 请求错误图表 SLA 口径
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:52:44 +08:00
benjamin
6acb46c113 fix: 标记通用网关本地调度容量错误
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:52:32 +08:00
benjamin
429adbc721 fix: 标记 OpenAI 本地调度容量错误
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:52:20 +08:00
benjamin
ae6ee23e2e fix: 调整 Ops 错误分类的 SLA 排除逻辑
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:52:06 +08:00
nanobabanan
e9a25e7b92 fix(apicompat): preserve empty streaming thinking blocks
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-05-18 15:10:35 +08:00
L494264Tt
1d47fd6300 This preserves DeepSeek reasoning_content across chat compatibility paths.
DeepSeek thinking-mode tool-call conversations may require the assistant
  reasoning_content from previous turns to be sent back in later requests. Without
  preserving it, those conversations can fail or lose reasoning context.

  Changes:
  - Preserve assistant reasoning_content when converting Chat Completions messages
    to Responses input by wrapping it as a thinking block.
  - Add regression coverage for non-streaming DeepSeek responses.
  - Add regression coverage for streaming DeepSeek deltas.
  - Add regression coverage that request-side messages[].reasoning_content is
    passed through with tool calls.

  Tests:
  go test -tags=unit ./internal/pkg/apicompat ./internal/service -run
  'TestChatCompletionsToResponses_AssistantReasoningContentPreserved|
  TestChatCompletionsToResponses_AssistantThinkingTagPreserved|
  TestForwardAsRawChatCompletions_PreservesDeepSeekReasoningContent|
  TestForwardAsRawChatCompletions_ForcesStreamUsageUpstreamAndPassesUsageDownstream
2026-05-18 11:22:23 +08:00
Yuhao Jiang
1b03240515 fix(payment): 修复支付宝官方扫码二维码生成错误
支付宝官方服务商在 precreate(当面付)不可用回退到 page.pay 时,
错误地把网页跳转 URL 当作可扫码二维码内容返回。前端用 QRCode 库
把这段 URL 渲染成二维码后,支付宝 APP 无法识别(扫到的只是个 HTTP
URL,不是支付二维码),用户必须点"重新打开支付页面"跳转到支付宝
收银台才能扫到真正可用的二维码。

- 后端 alipay.go:createPagePayTrade 不再把 PayURL 塞给 QRCode;
  createDesktopTrade 在 paymentMode == "redirect" 时跳过 precreate
  直接走 page.pay,避免没开通"当面付"的商户走一次无用的 API 调用
- 前端管理端 PaymentProviderDialog:让支付宝官方实例可在"支付模式"
  中选择"跳转",开启后始终在新标签页打开支付宝收银台
- ProviderCard 的 modeLabel 增加 redirect 分支
- 补充 TestCreateTradeRedirectModeSkipsPrecreate 单元测试

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 15:01:17 -05:00
Wesley Liddick
f5bd25bea0
Merge pull request #2530 from lyen1688/fix/openai-responses-sse-terminal
修复 OpenAI Responses SSE 终止事件识别
2026-05-17 16:20:04 +08:00
lyen1688
cc5328c491 修复 OpenAI Responses SSE 终止事件识别 2026-05-17 15:33:34 +08:00
wucm667
df82a3bc69 fix(openai): avoid null content when converting chat-completions to responses
When a chat-completions message has no usable content parts (empty array,
empty text part, or filtered-out image part), marshalChatInputContent
marshalled a nil slice to JSON null. The upstream Responses API rejects a
null content field with HTTP 400. Fall back to an empty string instead.

Fixes #2515
2026-05-17 11:20:05 +08:00
wucm667
44995404ef fix(docker): pin frontend builder pnpm to v9
`corepack prepare pnpm@latest` now resolves to pnpm 11, which promotes
ERR_PNPM_IGNORED_BUILDS to a hard error and breaks the frontend stage of
`docker build`. Pin pnpm to v9 to match the CI workflow
(pnpm/action-setup version: 9) and keep image builds reproducible.

Fixes #2442
2026-05-17 11:19:47 +08:00
haruka
3ca232ad06 fix(frontend): 编辑弹窗回退旧 credentials 结构以兼容旧后端
新代码仅依赖 credentials_status 会导致两种灰度场景被误判为未配置:
- 新前端 + 旧后端:旧后端未返回 credentials_status,前端读不到已脱敏的
  api_key / service_account_json,阻止保存。
- 旧前端 + 新后端:旧前端也读不到已脱敏字段(旧前端不在本 PR 范围)。

修复:
- API key 判断改为 credentials_status?.has_api_key ?? Boolean(currentCredentials.api_key)
- Vertex SA 判断:有 credentials_status 用 status,否则回退读
  credentials.service_account_json / service_account

补充测试覆盖:
- apikey/Vertex SA 各自的新后端脱敏响应、旧后端未脱敏响应、
  两者皆缺时阻止保存。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 03:02:08 +08:00
Brisbanehuang
26ca73a4cd fix: hide model scopes for non-antigravity plans 2026-05-17 02:20:41 +08:00
name
bec1e2b697 fix(openai): 永久禁用缺失 refresh_token 的 OAuth 账号
token_provider 在 expires_at 已过且 refresh_token 缺失时,仅返回 error,未做任何降级。
HandleUpstreamError 的 OAuth 401 分支也只走 10min 冷却,不区分账号是否具备刷新能力。
两条路径相加导致缺 refresh_token 的账号被反复选中、每次都在 token 阶段失败,对用户呈现持续 502。

token_provider.GetAccessToken: 命中"过期且无 refresh_token"时调用 SetError 永久禁用并清缓存,
依赖 background context 避免请求 ctx 提前结束影响落库。
ratelimit_service 401 OAuth 分支:refresh_token 为空时直接 SetError,不再写 expires_at、
不再 SetTempUnschedulable,缓存失效保留。RT 账号路径完全不动。

新增/调整测试覆盖两条路径,旧测试为 RT 路径补足 refresh_token 字段以保留原意图。
2026-05-16 19:40:23 +08:00
honue
360f8dec1a fix: 修复管理后台分组页可用账号数显示错误 2026-05-16 11:16:56 +08:00
name
0393bd7c82 Fix OpenAI compat usage parsing 2026-05-16 03:03:43 +08:00
yetone
b0c7723393
fix(admin/settings): make tab shell readable in dark mode
Vue's scoped-CSS compiler was dropping the `:global(.dark) .settings-tabs-shell`
rules in the production build, so the tab strip kept its light-mode white
background and the inactive tab labels (text-gray-300) showed at ~1.6:1
contrast — effectively unreadable.

Hoist the three dark-mode overrides into an unscoped `<style>` block so they
survive the scoped-CSS transform.
2026-05-16 01:00:03 +08:00
yangzc2004-bit
87fac30459 fix: use tier cooldown for google one gemini 429 2026-05-16 00:16:38 +08:00
Agoniedi
e46d2c2112 fix: avoid ops deep link initialization error 2026-05-15 23:59:51 +08:00
yetone
348a487739
fix(codex-transform): preserve underscore when rewriting call_* tool-call ids
`fixCallIDPrefix` builds malformed ids when the input has the standard
OpenAI `call_<nanoid>` prefix:

  input:  call_YYen1qxDejd2myJwcTCf7Nyp
  output: fcYYen1qxDejd2myJwcTCf7Nyp   ← no underscore between 'fc' and the nanoid

ChatGPT's codex backend then rejects the replayed item with:

  400 Invalid 'input[N].id': 'fcYYen1qxDejd2myJwcTCf7Nyp'.
       Expected an ID that contains letters, numbers, underscores, or
       dashes, but this value contained additional characters.

Sub2api wraps that into 502 to the client. Clients using the OpenAI SDK
on the OAuth/codex path see every multi-hop turn (after the first tool
call) fail because the item_reference rewritten this way gets sent on
every subsequent hop.

The other two branches of the same function correctly emit `fc_`
(line 1029: pass-through when already `fc*`; line 1035 fallback:
`fc_" + id`). Only the `call_` → `fc_` rewrite was missing the
underscore — looks like a copy-paste slip during the original commit.

Fix: change `"fc"` to `"fc_"` on the call_ branch. One character.

Repro:
  client (OpenAI SDK) sends a function_call_output whose call_id is
  `call_<nanoid>` (default OpenAI format). The sub2api request body
  also contains an item_reference whose id mirrors the call_id (also
  `call_<nanoid>`). On the codex OAuth path, this rewrite fires for
  the item_reference's id, producing the malformed value.

Affects: `platform=openai type=oauth` accounts whose clients use the
official OpenAI SDK / Responses API conventions (id prefix `call_`).
API-key accounts and bridge-mode requests are untouched.
2026-05-15 23:29:56 +08:00