feeeei
c19204289d
fix(affiliate): 线下提现登记按 Idempotency-Key 幂等
...
登记请求只有金额,提交成功但响应丢失时,管理员重试会把同一笔站外打款再扣
一次返利额度。现在一次登记由 Idempotency-Key 标识,数据库在同一事务内以唯一
约束去重:
- user_affiliate_ledger 新增 operation_id(幂等键派生的 SHA-256)与部分唯一
索引(迁移 240);接口要求 Idempotency-Key,缺失或非法返回 400
- 事务内先以 operation_id 写入占位流水,再解冻、扣减并补写额度快照;同键
重试返回首笔流水的结果并带 X-Idempotency-Replayed,不重复扣减;同键换了
用户或金额返回 409 IDEMPOTENCY_KEY_CONFLICT;额度不足时占位随事务回滚
- 并发的同键请求在唯一索引上等待先到者:先到者提交则返回同一条流水,回滚
则自行登记
- 弹窗在网络错误、超时、5xx、408/409 时锁定用户与金额,重试沿用同一请求与
幂等键;幂等键按管理员、用户、金额暂存于 sessionStorage,登记有确定结果后
释放
2026-09-23 01:24:59 +08:00
feeeei
57b7dbdc85
feat(affiliate): 提取记录支持登记线下提现
...
管理员在站外给邀请人打款后,系统里原本无法扣减对应的返利额度,用户仍可把
这部分额度转入余额。现在可在「邀请返利 → 提取记录」点「登记线下提现」,
从该用户的可提取返利额度中扣除已打款金额:
- POST /api/v1/admin/affiliates/users/:user_id/withdraw,请求体只含 amount,
金额按 8 位小数舍入后校验
- 先解冻已到期的冻结额度,再以 aff_quota >= amount 为条件原子扣减,写入
action=withdraw 的流水并带额度快照;额度不足返回 AFFILIATE_QUOTA_INSUFFICIENT
- 不新增字段与迁移:线下提现复用已有 action 列区分,操作人由管理端审计日志记录
- 提取记录同时列出转入余额与线下提现,新增「类型」列
- 弹窗选择用户后展示可提取额度,支持一键填入全部;从未产生返利的用户按 0 处理
返利记录改为 LEFT JOIN 订单与被邀请人,兑换码、管理员充值来源的返利也会出现
在明细中,接口里订单相关字段与被邀请人 ID 可为 null。
2026-09-17 23:42:02 +08:00
Wesley Liddick
18328aed05
Merge pull request #7212 from wucm667/feat/issue-7203-redemption-pagination
...
feat(redeem): paginate user redemption history
2026-09-17 16:43:06 +08:00
wucm667
a9ed218989
feat(redeem): paginate user redemption history
2026-09-16 13:19:15 +08:00
HuntercodeT
da74bf13a4
fix(gemini): discover antigravity mappings in native model lists
2026-09-15 16:50:46 +08:00
Wesley Liddick
25c21aedda
Merge pull request #7129 from kk-418/fix/grok-build-responses-sequence-number
...
fix(responses): 始终在 Responses SSE 中写出 sequence_number 避免反序列化失败
2026-09-15 15:28:33 +08:00
Wesley Liddick
1920a7d687
Merge pull request #7091 from SavitarC/feat/subscription-bulk-actions
...
feat: 支持订阅管理批量操作
2026-09-15 08:57:27 +08:00
Wesley Liddick
dd2e6b3680
Merge pull request #7076 from Shen-An/fix/antigravity-refresh-warning
...
fix(admin): surface partial Antigravity refresh warnings
2026-09-15 08:54:06 +08:00
cikenerd and Cursor
087987070b
fix(responses): 为 grok-build 始终写出 sequence_number
...
网关合成/重编的 Responses SSE 因 omitempty 或缺字段丢掉 sequence_number,
grok-build 会整轮反序列化失败。合成失败帧、compact 桥接和转换 wire JSON
一律写出该字段,0 也保留。
Fixes #7128
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-09-14 11:45:53 +08:00
chihao.ou
28a4ea914d
fix(proxy): allow explicitly clearing stored credentials
2026-09-13 17:23:24 +08:00
SavitarC
e3cce574d7
fix: serialize subscription extensions
2026-09-13 12:33:35 +08:00
SavitarC
3d6c207723
feat: 支持订阅管理批量操作
2026-09-13 11:49:03 +08:00
Wesley Liddick
c7ed614240
Merge pull request #7001 from SavitarC/feat/ops-token-stats-all-platforms
...
feat(ops): 扩展 Token 请求统计至所有平台
2026-09-12 19:34:45 +08:00
Wesley Liddick
6206ce940e
Merge pull request #6929 from feeeei/fix/gemini-inband-response-signals
...
fix(gemini): 原生路径登记 2xx 响应里的带内错误信号
2026-09-12 16:08:26 +08:00
Shen-An and Claude Sonnet 5
c6727ed4c9
fix(admin): surface partial Antigravity refresh warnings
...
Return the updated account alongside partial refresh warnings so the admin UI can keep its state current and tell operators when project ID retrieval must retry.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com >
2026-09-12 15:19:19 +08:00
Wesley Liddick
4726bdd08b
Merge pull request #6890 from slovx2/feat/openai-images-75be
...
feat(openai): route OAuth image requests through native Codex Images
2026-09-11 17:29:54 +08:00
Wesley Liddick
cdb5cfaf6c
Merge pull request #6747 from DuskLin/feat/opencode-go-platform
...
feat(opencode): 增加 OpenCode 平台支持(Zen / GO)
2026-09-11 16:42:05 +08:00
Wesley Liddick
dfa83fbe93
Merge pull request #6986 from feeeei/feat/site-billing-mode
...
feat(settings): 新增「站点类型」开关(充值 & 订阅 / 仅充值 / 仅订阅)
2026-09-11 16:34:46 +08:00
Wesley Liddick
2dff7af0f9
Merge pull request #6954 from feeeei/fix/quota
...
fix(quota): 修复仪表盘默认会给所有人分配显示所有平台卡片的问题
2026-09-11 16:34:18 +08:00
song
c0d5119375
feat(openai): route OAuth image requests through native Codex Images
...
Use shared model routing for image forwarding and account tests, retain Luna orchestration for legacy models, and add Image 2.5 pricing and usage accounting.
2026-09-11 15:57:09 +08:00
刘佳林
efcc2252e5
fix(opencode): address review on dispatch, billing, session, and 402
...
Skip OpenAI messages-dispatch gpt-5.x defaults for OpenCode groups and
composite OpenCode targets. Filter unpriced claude-* billing candidates,
estimate count_tokens locally, sanitize body session IDs before setting
X-OpenCode-Session, and treat Zen 402 as recoverable payg cooldown.
Stop rewriting the inbound body before protocol routing so account
model_mapping applies once and usage_logs.model stays the client name.
2026-09-11 15:39:13 +08:00
Wesley Liddick
fd300ab6f3
Merge pull request #6974 from alfadb/fix/deepseek-v41-flash-pricing
...
fix(billing): 适配 DeepSeek V4.1-Flash 新价与 pro→Flash 计费切换
2026-09-11 13:58:23 +08:00
Wesley Liddick
14029e50aa
Merge pull request #6661 from whhphd/fix/grok-media-slot-release
...
fix(grok): release abandoned media slots and preserve video ownership
2026-09-11 13:57:07 +08:00
Wesley Liddick
3fb03cdac1
Merge pull request #6960 from xlplbo/fix/openai-ws-exec-scope-preemption
...
fix(openai-ws): ctx_pool 会话抢占与会话状态按 codex 线程隔离
2026-09-11 13:56:52 +08:00
xlplbo
d0ca057ca4
fix(openai): WS 会话被抢占时先发关闭帧再取消
2026-09-11 10:25:50 +08:00
SavitarC
1035a4daf0
feat(ops): support token request stats across all platforms
2026-09-11 10:16:32 +08:00
刘佳林
242907854d
feat(opencode): add OpenCode platform with Zen and GO account types
...
Keep the internal platform ID opencode_go. Product surface is OpenCode
with account_mode zen|go, model-aware routing across Chat Completions,
Responses, and Anthropic Messages, and X-OpenCode-Session derived from
prompt_cache_key / metadata.user_id so prompt cache can hit.
Unmatched models fall back to /v1/chat/completions. Related to #6742 .
2026-09-11 10:05:24 +08:00
Wesley Liddick
f4dd88b001
Merge pull request #6847 from ouchihao/codex/issue-4064-custom-page-button-visibility
...
feat(settings): allow hiding the custom page open button
2026-09-11 09:34:11 +08:00
Wesley Liddick
43f9383d40
Merge pull request #6869 from Garfielk/codex/fix-heartbeat-envelope-fields
...
fix(openai): accept full heartbeat bootstrap envelopes
2026-09-11 09:30:45 +08:00
feeeei
9d475f9edb
feat(settings): 新增「站点类型」三态开关,关闭订阅后用户端收起所有「订阅」入口与文案
...
后台功能开关页新增「站点类型」单选:充值 & 订阅(默认,即现状)/ 仅充值 / 仅订阅。
它由两个后端开关派生并在保存时同时写回:
- subscription_enabled(新增;默认 true,缺省/空值视为开启,仅显式 false 关闭),按既有
开关模式贯通常量、公共设置、SSR 注入载荷、默认值、更新写入、DTO、审计 diff 与前端注册表;
- payment_balance_disabled(支付配置里既有的 BALANCE_PAYMENT_DISABLED,此前只能走接口/数据库
改),补进公共设置与注入载荷,让用户端在任何鉴权请求之前就能推导站点类型。
两者都关闭是接口层可表达但 UI 不提供的组合,前端归为「仅充值」,后台保存时会把余额充值重新打开。
「仅充值」时的表现:
- 用户侧边栏隐藏「我的订阅」,「充值/订阅」入口收窄为「充值」;管理端侧边栏隐藏「订阅管理」
入口(页面仍可通过地址访问);
- 购买页不再渲染「订阅」tab,只剩单个 tab 时顶部切换器随之隐藏;tab 列表变化时当前 tab
自动收敛到可用项(关闭订阅回到充值、仅订阅站点重新打开订阅进入订阅),列表为空时展示
「充值与订阅均暂未开放」而不是一个必定被后端拒绝的充值表单;
- /purchase 的页头标题/描述与 document.title 改走 resolveRouteMetaKeys 按站点类型切换;
- /subscriptions 路由新增 requiresSubscription 守卫,直达时重定向到仪表盘;
- 顶栏订阅进度徽章不再挂载,App.vue、PaymentView 与徽章组件都不再预加载/轮询订阅接口;
- 用量页隐藏「计费类型(余额/订阅)」筛选,Key 用量公开页「订阅类型」行改为「计费方式」。
「仅订阅」时侧边栏入口与页头显示为「订阅」,购买页只剩订阅 tab(余额下单由后端既有逻辑拒绝)。
购买订阅接口、已有订阅的计费、兑换码发放订阅与管理端订阅管理页面本身均不受影响。
featureFlags 抽出纯函数 resolveFeatureFlag,新增 utils/siteBillingMode 承载三态派生与反解,
PaymentView 测试改用响应式 store mock 覆盖开关双向切换。
2026-09-11 00:50:17 +08:00
alfadb
ab9bd9e877
fix(billing): 适配 DeepSeek V4.1-Flash 新价与 pro→Flash 切换
...
- flash 低谷价更新为 $0.15/$0.60/$0.003 per MTok(2026-09-10 官方降价)
- deepseek-v4-pro 自 2026-09-14 04:00 UTC 起按 Flash 价计费(上游路由变更)
- 计费时点显式驱动 pro→Flash 切换,定价展示与计费两条路径同源
- deepseek-flash 保留 reasoning_effort=max;补 Codex 模型清单与前端白名单
- 价表 JSON 新增 deepseek-flash 条目并同步 flash 系价格
2026-09-10 22:10:29 +08:00
feeeei
4a4b50d807
fix(quota): 平台限额表只保存已配置限额的记录,仪表盘按用量与限额展示平台
...
user_platform_quotas 只保存至少配置了一档限额的记录;不存在的行等价于不限额。
- 注册播种只为配置了限额的平台建行,一个都没有时不写入
- IncrementUsageWithReset 无行时不再 fail-open 建行
- BatchSnapshotUsage 改为只更新既有活跃行,不再插入无限额的新行
- 仓储 BulkInsertInitial/UpsertForUser 把三档全空的记录视为未配置;
管理员全量替换接口同样剔除,清空限额即软删并放弃累计用量
- 迁移 238 删除三档全 NULL 的历史行
- 用户仪表盘平台卡片 = 有用量的平台 ∪ 配置了限额的平台,计数改为卡片数
- 管理员限额弹窗对未保存限额的平台禁用"重置窗口"
2026-09-10 16:41:58 +08:00
r266-tech
1c0932e173
feat(gateway): retrieve models from the visible catalogue
2026-09-10 15:57:17 +08:00
feeeei
44bc47a3e3
fix(gemini): 原生路径登记 2xx 响应里的带内错误信号
...
Gemini API-key 原生转发对上游 2xx 只抽 usage 原样透传:finishReason 内容拦截、
promptFeedback.blockReason、事件里的 Google 错误信封、空响应都被当作成功,
ops 错误日志、用户错误页、渠道监控全部没有记录。
- 新增 gemini_response_signal:逐事件判定三类带内信号,流式按优先级登记最高者;
没有 data 事件时对非 SSE 的兜底正文整段判定,空体登记 EMPTY_STREAM / EMPTY_RESPONSE
- 内容策略类按请求级结果登记(invalid_request_error / 400,business limited,
不做上游归因、不计 SLA);错误信封、生成异常、空响应按上游失败登记并计 SLA
- OpsStreamError 新增 RequestScoped / NonStream:请求级带内行不受残留上游上下文与
skip_monitoring 影响,落库状态取 IntendedStatus;中间件保留此前尝试的恢复行
- 客户端字节、wire 状态、用量与计费不变
2026-09-10 02:59:15 +08:00
刘世俊
a0babc93dd
fix(openai): accept full heartbeat bootstrap envelopes
2026-09-09 12:48:57 +08:00
chihao.ou
1d4e0436e4
feat(settings): allow hiding the custom page open button
2026-09-08 21:18:56 +08:00
Wesley Liddick
29646ba6b4
Merge pull request #6488 from aofee/codex/feat-grok-media-eligibility-ui
...
feat: add Grok media eligibility controls
2026-09-08 20:46:20 +08:00
Wesley Liddick
52f7bcaedd
Merge pull request #6759 from ssharkkky/feat/cmv2-user-ranking-toggle
...
feat(channel-monitor-v2): add user ranking toggle and keep missing TTFT neutral
2026-09-08 20:44:07 +08:00
Wesley Liddick
43569bb44c
Merge pull request #6434 from swjturay/codex/upstream-client-disconnect-drain
...
fix(openai-ws): drain upstream after client disconnect
2026-09-08 20:42:59 +08:00
Wesley Liddick
15557e7796
Merge pull request #6235 from StarryKira/codex/fix-6232-channel-cache-invalidation
...
fix: broadcast channel cache invalidations across instances
2026-09-08 20:42:45 +08:00
Wesley Liddick
4e9b01fd59
Merge pull request #6838 from atogumo/fix/claude-code-probe-any-model
...
fix(gateway): accept Claude Code max_tokens=1 probes for any model
2026-09-08 20:42:24 +08:00
Wesley Liddick
1e6114c270
Merge pull request #6812 from Pluviobyte/codex/fix-model-plaza-subscriptions
...
fix(model-plaza): include active subscription groups
2026-09-08 20:10:42 +08:00
Wesley Liddick
9e7039ebca
Merge pull request #6811 from Pluviobyte/codex/fix-proxy-partial-update
...
fix(proxies): preserve omitted expiry and fallback settings
2026-09-08 20:10:20 +08:00
atogumo
4e5d67df35
fix(gateway): accept Claude Code max_tokens=1 probes for any model
...
The claude_code_only probe exemption only fired for models containing
"haiku". Claude Code also sends max_tokens=1 requests without a system
prompt to the model currently in use, e.g. when switching models or
refreshing the context usage, so on sonnet/opus groups those requests failed
the system-prompt check and were rejected as non-Claude-Code clients.
Recognise the probe from the request body itself (max_tokens == 1) once the
User-Agent check has passed, regardless of model, and carry max_tokens into
the ParsedRequest projection so the hot path sees it too. The haiku context
flag and the local haiku interception are unchanged; non-haiku probes reach
the pool as ordinary one-token requests. One output token offers nothing to
a client that already forges the CLI User-Agent, so this widens no attack
surface.
Fixes #6591
2026-09-08 19:12:37 +08:00
Wesley Liddick
dbe92a1c24
Merge pull request #6758 from DuskLin/feat/minimax-platform
...
feat(minimax): 增加 MiniMax 平台支持
2026-09-08 18:50:06 +08:00
刘佳林
3495635a52
fix(minimax): 补齐阈值停调与额度监控接线
...
调度阈值评估和渠道监控 quota 取数补上 MiniMax 分支;GetCodingPlanProvider 改为只认官方域名,避免把中转 Key 发到厂商额度端点。composite /v1/models 与 Codex 目录纳入 MiniMax;迁移改名为 237;allowlist 去掉未使用的 www.* / api.minimax.cn,abab 前缀收窄到 5/6/7。
2026-09-08 17:41:29 +08:00
Rain
38cfd7e2d9
fix(proxies): preserve omitted expiry and fallback settings
2026-09-08 13:38:41 +08:00
Rain
3fc08745a6
fix(model-plaza): include active subscription groups
2026-09-08 13:37:53 +08:00
Wesley Liddick
5485f368b2
Merge pull request #6690 from alfadb/fix/astra-pro-mode
...
fix(openai): 保留 Codex OAuth 请求中的 Astra reasoning.mode
2026-09-07 20:42:37 +08:00
shaw
2031c1d5ad
fix(groups): merge main and resolve model allowlist conflicts
...
Resolve three conflicts from main's #6680 (supplementUnmappedOpenAIModels):
1. gateway_handler.go — keep PR's allowlist refactoring (ModelAllowlistEnabled,
writeAllowlistedModelsList, modelListingSource); main's OpenAI branch in
writeModelsList was auto-merged.
2. group_models_list.go (modify/delete) — delete file per PR intent; relocate
supplementUnmappedOpenAIModels to group_model_allowlist.go where gateway_service
and openai_codex_models_service can still call it.
3. openai_codex_models_service.go — combine main's supplementUnmappedOpenAIModels
wrapping with PR's ModelAllowlistEnabled() guard.
Also fix two auto-merged test files that still referenced the old
GroupModelsListConfig / ModelsListConfig types.
2026-09-07 19:44:03 +08:00