Yuan Liu and Claude Opus 5.5
a2007db707
fix(billing): keep catalog image prices when channel pricing leaves them unset
...
When a channel pricing entry left image_output_price empty,
GetModelPricingWithChannel and the pricing resolver zeroed the image
output price and marked it explicit, so image output tokens were billed
at $0. image_input_price followed the same "unset means zero" rule and
fell back to the text input price instead of the catalog image input
price. A channel that lists an image model such as gpt-image-2 in token
mode without filling in prices therefore generated images without
charging for image output tokens, while the available-channels view
(#2475 ) displayed the catalog image price for the same entry.
#2930 wanted an explicit 0 on the channel to stop falling back to the
catalog; the change applied the same treatment to unset values as well.
Treat the two image fields like every other token price field:
- Set on the channel (including 0): override the catalog. An explicit
image_output_price keeps ImageOutputPriceExplicit, so 0 stays free.
- Left empty: keep the catalog price (LiteLLM or built-in fallback). If
the catalog has none, computeTokenBreakdown still falls back to the
text input/output price.
The admin UI saves an empty field as null and only an entered 0 as 0,
so the two cases stay distinguishable. The flat, interval and
GetModelPricingWithChannel paths now share applyChannelImagePriceOverrides.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
2026-09-24 15:46:14 +08:00
github-actions[bot]
a3eb7ef302
chore: sync VERSION to 0.2.8 [skip ci]
2026-09-23 09:18:46 +00:00
Wesley Liddick
fd80b08c90
Merge pull request #5616 from alfadb/feature/opencode-go-usage-window
...
feat(opencode): 支持 OpenCode Go 用量窗口(opencode_go 平台账号 + 多厂商挂载复用)
v0.2.8
2026-09-23 15:39:28 +08:00
alfadb
dc9216512d
fix(opencode): normalize the quota endpoint for the /zen/go base variant
...
OpenCode Go 有两个都合法的 base_url:https://opencode.ai/zen/go/v1(OpenAI
协议档,DefaultOpenCodeGoBaseURL)与 https://opencode.ai/zen/go(Anthropic
协议档,前端 defaultCNBaseUrl 会写入)。旧拼接只做 strings.TrimRight(base,
"/") + "/usage",Anthropic 档账号的额度探测必然打到 /zen/go/usage。
实测证据(curl 无鉴权,401=端点存在,404=不存在):
401 https://opencode.ai/zen/go/v1/usage
404 https://opencode.ai/zen/go/usage
修法沿用同包 kimiQuotaURL(coding/v1 与 coding 两种 base)的既有惯例:
TrimSuffix(base, "/v1") 后统一拼回 /v1/usage,两个变体与尾斜杠写法都归一到
https://opencode.ai/zen/go/v1/usage;自定义 base 保持同一语义。
2026-09-23 15:26:44 +08:00
alfadb
d0731be2f0
fix(opencode): lite 列表 DTO 补 opencode_go_usage,修复列表页显示余额
2026-09-23 15:26:44 +08:00
alfadb
a2e1618700
fix(opencode): 纠正 CASE 求值顺序注释并补齐 mode 语义护栏
2026-09-23 15:26:44 +08:00
alfadb
31635849e0
fix(opencode): 用量单元格与 CN 子单元格互斥,避免重复渲染
2026-09-23 15:26:44 +08:00
alfadb
d03274ad5f
feat(opencode): 用量窗口资格支持 OpenCode 平台并扩展到其它厂商挂载
2026-09-23 15:26:44 +08:00
alfadb
0c860e81e1
fix(i18n): merge duplicate opencodeGo locale blocks after upstream rebase
2026-09-23 15:26:44 +08:00
alfadb
daf6cbb5d9
feat(opencode): 用量单元格支持主动查询并将周/月徽章改为 7d/1m
2026-09-23 15:26:44 +08:00
alfadb
912e1c414c
fix(opencode): remove stray conflict-marker text from usage cell imports
2026-09-23 15:26:35 +08:00
alfadb
0a43efb9a4
fix(opencode): preserve managed usage state on account updates
2026-09-23 15:26:35 +08:00
alfadb
f7f0a56f35
fix(opencode): preserve auto-refresh on usage refresh
2026-09-23 15:26:35 +08:00
alfadb
ae2735cdb6
feat(opencode): 用量窗口支持同 Key 组共享、活动防抖与超窗强刷
...
与 Ollama Cloud usage 对齐:OpenCode Go 作为同 Key 聚合订阅,
多个 openai/apikey/base_url=opencode.ai/zen/go/v1 账号共享同一份
用量状态与刷新节奏:
- 组共享:组指纹 sha256("opencode.ai\0"+api_key);auto_refresh 开关
与 snapshot 按组写(事务 + FOR NO KEY UPDATE + 锚点 CAS + 纯合并,
写 snapshot 不会抹掉开关);列表/详情经 ResolveAccounts 组内共享;
账号换 Key → IdentityChanged → 组级关闭 auto_refresh 并清快照
- 活动防抖 + 超窗强刷:settings 新增 debounce_minutes(默认 1,
1-60,必须小于 interval_minutes);模型请求活动经网关 5 处调用点
驱动刷新,due = min(lastUsed+debounce, fetchedAt+maxWait),
成功路径有 5 分钟最小抓取间隔,失败路径退避优先
- 手动刷新限频 10s→30s 且按组;singleflight/RunDue 按组去重;
ListDue 在 SQL 内按组算 due(CTE 分组取组内 MAX(last_used_at))
验证:go build + 五包回归 OK;新增组共享/三态 due/组单飞/
IdentityChanged/debounce 校验单测全绿;vitest 11 例全绿;
vue-tsc 零错误。
2026-09-23 15:26:35 +08:00
alfadb
6624947b62
feat(opencode): 支持 OpenCode Go 官方用量窗口查询与自动刷新
...
OpenCode Go 上游(https://opencode.ai/zen/go/v1)官方提供用量端点
GET /zen/go/v1/usage(Bearer 复用消费 key),返回 rolling(5h)/weekly/monthly
三窗口的 percent 与 resetsAt。本提交为 openai apikey 账号(base_url 为
opencode.ai/zen/go/v1)接入该用量窗口:
- 后端:OpenCodeGoUsageService——手动刷新(每账号 10s 节流)、
周期自动刷新(全局开关 + 账号开关双开启,interval 5-1440 分钟,
leader lock + 每轮 20 账号 + 并发 4)、失败指数退避(上限 24h)、
Retry-After 尊重;401→unauthorized、403→failed;snapshot 持久化于
accounts.extra(单账号写入,无分组 CAS、无会话加密)
- admin API:settings GET/PUT、/:id/opencode-go-usage GET、
auto-refresh PUT、refresh POST(与 Ollama Cloud usage 同构)
- 前端:账号列表行内三窗口进度条(复用 UsageProgressBar)、
编辑弹窗内配置面板(详情+手动刷新+auto-refresh)、全局设置卡片、
en/zh i18n
验证:
- 上游端点已用生产真实 Go key 实测 200,响应
{"usage":{"rolling":{"status":"ok","percent":6,...},...}}(2026-08-13)
- go build ./... OK;service/handler/repo/dto/cmd 全量回归 OK
- 新增单测 20 例(解析 401/403/畸形 JSON、退避、节流等)全绿
- frontend vitest 新增 7 例 + Ollama 回归 4 例全绿;vue-tsc 零错误
2026-09-23 15:26:35 +08:00
Wesley Liddick
afd069b169
Merge pull request #7532 from alfadb/feature/claude-cli-version-sync
...
feat(claude): 自动同步 Claude Code 客户端版本号,无需改代码跟随官方版本
2026-09-23 14:54:36 +08:00
shaw
6452aeffa1
fix(claude): 修复版本同步契约测试和缓存刷新
2026-09-23 14:39:29 +08:00
Wesley Liddick
4318a63bd8
Merge pull request #7509 from lyy0709/codex/gpt6-sol-luna-opus55
...
feat(models): support GPT-6 Sol, Luna and Claude Opus 5.5
2026-09-23 14:23:38 +08:00
alfadb
ca08825935
feat(claude): 自动同步 Claude Code 客户端版本号
...
出站伪装用的 Claude Code 版本号此前硬编码在 claude.CLICurrentVersion,
只能靠环境变量 SUB2API_CLAUDE_CLI_VERSION 覆盖且需重启;Anthropic 抬高
版本下限时(如 Opus 5.5 要求 >= 2.1.280)必须改代码发版才能跟上。
改为每小时从官方 GitHub Releases 同步最新稳定版,无需重启也无需发版。
- 新增 ClaudeCodeVersionSyncService:1 小时间隔,数据源 anthropics/claude-code
的 releases/latest,失败回退最近 30 条列表;过滤 draft/prerelease;
只向前推进,拉取失败保留上次值不降级;面板可关闭
- 新增三个设置项:claude_code_client_version(管理员手动固定)、
claude_code_client_version_synced(同步服务独占写)、
claude_code_version_auto_sync_enabled(开关,默认开)
- 取值优先级:面板手动值 -> 同步值 -> SUB2API_CLAUDE_CLI_VERSION -> 内置基线,
每层经 IsSupportedCLIVersion 校验,含 60s 缓存与 singleflight
- 版本号运行期化:claude.DefaultHeaders 由包级 var 改为函数,新增
EffectiveCLIVersion/DefaultUserAgent 与 SetCLIVersionResolver(未注入时
与 CLIVersion() 等价);identity 的 defaultFingerprint 不再在包 init 固化,
指纹下限与主版本超前校验改用运行期值
- 守住一致性铁律:buildUpstreamRequest 与 count_tokens 各取一次 UA 字符串,
同时喂给出站 User-Agent 头与请求体 billing 的 cc_version,避免缓存翻转
瞬间头体版本不一致被判非正版客户端
- 管理后台设置页新增配置区块,含中英文案与「当前同步到」只读展示
2026-09-23 13:35:44 +08:00
lyy0709
c060aa0031
fix(models): repair tests after rebasing onto upstream main
...
Close the existing catalog identity test before the new capability test and
assert that an explicit null capability remains present. Update the quota
snapshot fixture to the pointer parameter already used by the current base.
Verified six full backend unit packages, scoped lint and CGO-disabled build.
2026-09-23 12:01:40 +08:00
shaw
5e244e7382
fix(test): 修复调度倍率参数变更后的 CI 编译失败
2026-09-23 11:36:08 +08:00
lyy0709
5b5f315b87
chore: remove model selector review screenshot
2026-09-23 11:27:49 +08:00
lyy0709
c4c2e66070
feat(models): support GPT-6 Sol, Luna and Claude Opus 5.5
2026-09-23 11:27:49 +08:00
Wesley Liddick
d8d5e1dd35
Merge pull request #7282 from feeeei/feat/affiliate-offline-withdrawal
...
feat(affiliate): 提取记录支持登记线下提现
2026-09-23 11:20:32 +08:00
Wesley Liddick
59a00631ed
Merge pull request #7478 from superzcj/codex/simple-mode-key-window-limits
...
feat: optionally enforce API-key spending windows in simple mode
2026-09-23 11:19:17 +08:00
Wesley Liddick
b2d6b954a1
Merge pull request #7090 from Brisbanehuang/codex/scheduling-rate-account-fallback
...
fix(scheduler): 无有效探测时回退账号倍率,支持 OAuth 参考倍率留空
2026-09-23 11:18:37 +08:00
Wesley Liddick
1947add842
Merge pull request #7288 from feeeei/feat/backup-monthly-archive
...
feat(backup): 支持月度归档与独立保留策略
2026-09-23 11:18:08 +08:00
Wesley Liddick
6b71d75bde
Merge pull request #4867 from coo1white/fix-backup-s3-secret-reencrypt
...
fix(backup): keep the S3 secret encrypted when a save inherits it
2026-09-23 11:17:55 +08:00
Wesley Liddick
f53252e292
Merge pull request #6844 from ouchihao/codex/issue-6837-groups-manifest-test-pinia
...
test(groups): initialize Pinia in Codex manifest regression
2026-09-23 11:17:41 +08:00
Wesley Liddick
61e7d31605
Merge pull request #7513 from Achordchan/fix/channel-video-pricing-preview
...
fix(channels): display video pricing per second
2026-09-23 11:17:27 +08:00
shaw
033047b7d4
chore(docs): 移除已删除文档的忽略例外
2026-09-23 10:36:16 +08:00
shaw
d68a68fd0d
chore(docs): 清理 PR 误入的文档和截图
2026-09-23 10:35:34 +08:00
Wesley Liddick
31a6e74770
Merge pull request #7491 from Thinker-Joe/fix/openai-picker-model-mapping
...
fix(openai): scope the account test picker to the account model mapping
2026-09-23 10:31:36 +08:00
Wesley Liddick
7c0a2a556c
Merge pull request #7160 from StarryKira/codex/log-retention-upstream
...
feat: 支持运维与请求日志的滚动保留设置
2026-09-23 10:07:25 +08:00
Wesley Liddick
0dd71286f2
Merge pull request #7060 from heathermhuang/fix/composite-image-models-6076
...
fix(images): allow compatible Gemini models on API-key upstreams
2026-09-23 10:07:02 +08:00
Wesley Liddick
b350e079f8
Merge pull request #7139 from HP-network/fix/api-key-model-401-failover
...
fix: keep API-key accounts available for unknown models
2026-09-23 10:05:42 +08:00
Wesley Liddick
24872fda7c
Merge pull request #7493 from ouchihao/codex/bug-temp-unsched-race
...
fix(accounts): keep temporary unschedulable status scoped to the current account
2026-09-23 10:03:22 +08:00
Wesley Liddick
5ad7cf4fb9
Merge pull request #7300 from lizhaoxinlizhaoxin2-lab/fix/responses-stream-error-schema
...
fix(responses): emit protocol-correct stream errors once
2026-09-23 10:03:00 +08:00
Wesley Liddick
60b9bf7558
Merge pull request #7308 from HuntercodeT/fix/codex-manifest-non-gpt-identity
...
fix(codex-models): 非 GPT 模型的 Codex 提示词模板去掉 GPT 身份声明,避免 Antigravity 429
2026-09-23 10:01:45 +08:00
Wesley Liddick
d6e8b44bcb
Merge pull request #7411 from HuntercodeT/fix/antigravity-vendor-identity-429
...
fix(antigravity): neutralize Claude Agent SDK identity in system prompts
2026-09-23 10:01:18 +08:00
Wesley Liddick
fa3f526785
Merge pull request #7489 from doublepi123/fix/tool-schema-null-required
...
fix(tools): 清洗工具 Schema 里非法的 null required,修复 xAI / Moonshot 400
2026-09-23 10:01:03 +08:00
Wesley Liddick
7d5615998c
Merge pull request #7492 from ouchihao/codex/bug-monitor-detail-race
...
fix(channel-monitor): ignore stale detail requests
2026-09-23 10:00:49 +08:00
Wesley Liddick
d7e4bba0e7
Merge pull request #7494 from ouchihao/codex/bug-balance-error-message
...
fix(users): show normalized API errors in the balance dialog
2026-09-23 10:00:30 +08:00
Wesley Liddick
d3d0f653e5
Merge pull request #7495 from ouchihao/codex/bug-subscription-expiry-label
...
fix(subscriptions): use calendar dates for expiry labels
2026-09-23 09:59:49 +08:00
Wesley Liddick
9e0e146984
Merge pull request #7496 from ouchihao/codex/bug-totp-late-timer
...
fix(profile): avoid starting TOTP cooldowns after unmount
2026-09-23 09:59:22 +08:00
Wesley Liddick
fc4465f78b
Merge pull request #7498 from ouchihao/codex/bug-model-tag-ime
...
fix(channels): preserve model tags during IME composition
2026-09-23 09:58:50 +08:00
Wesley Liddick
0eaa7c3c84
Merge pull request #7499 from ouchihao/codex/bug-date-picker-midnight
...
fix(date-picker): refresh relative dates after midnight
2026-09-23 09:58:36 +08:00
Wesley Liddick
5e4968492f
Merge pull request #7500 from ouchihao/codex/bug-user-attribute-race
...
fix(users): discard stale user attribute responses
2026-09-23 09:57:53 +08:00
Wesley Liddick
a81547f244
Merge pull request #7501 from ouchihao/codex/bug-profile-dingtalk-source
...
fix(profile): recognize DingTalk profile sources
2026-09-23 09:57:39 +08:00
Achord Chan
bdb9a91db0
fix(channels): display video pricing per second
2026-09-23 09:09:37 +08:00