Wesley Liddick
6f43986c37
Merge pull request #3811 from jianjianai/hotfix/admin-scheduler-score-opt-in
...
fix(admin): 管理员账号列表默认关闭调度权值计算以降低负载
2026-07-08 10:22:10 +08:00
Wesley Liddick
f407d6a044
Merge pull request #3804 from fengshao1227/fix/compact-body-signal-routing
...
fix(compact): 识别 /v1/responses body 中的 compaction_trigger 信号
2026-07-08 10:12:58 +08:00
shaw
a56eb5b4dc
fix(compact): body-signal 提升上移到 handler 层并对齐 path-based 链路
...
合并 main 解决拆分冲突后,将原先 Forward 内的 body-signal 提升重构到
handler 的 compact 归一化入口之前,修复原方案的四个问题:
- reqStream 未重推导:body-signal 原始请求带 stream:true,Forward 级提升
后 compact 上游返回 JSON(Accept: application/json)却被流式 handler
解析,"stream ended before a terminal event" 会触发最多
max_account_switches 次换号 failover,且每次都白烧一次上游 compact 配额;
handler 级提升让白名单归一化先删除 stream,reqStream 自然为 false。
- requireCompact 调度过滤失效:原方案 path 改写发生在 requireCompact 判定
之后,调度器不会过滤不支持 compact 的账号;现在改写先于该判定。
- passthrough / Grok / chat-completions 桥接分支位于 Forward 检测点之前,
passthrough 账号完全无法命中;handler 级改写对所有分支生效。
- body 归一化口径不一致:body-signal 现在与 path-based 一样走白名单归一化
(prompt_cache_key 等一并删除),而非仅依赖 OAuth 黑名单转换。
检测函数导出为 HasCompactionTriggerInInput 供 handler 使用,保留原 PR 的
7 个单测;新增 6 个 handler 级回归测试(提升、codex 别名路由、尾斜杠、
子路径不误伤、path-based 无双重后缀、普通请求不受影响)。
Refs #3777
2026-07-08 10:04:14 +08:00
shaw
a855317624
Merge remote-tracking branch 'origin/main' into fix/compact-body-signal-routing
...
# Conflicts:
# backend/internal/service/openai_gateway_service.go
2026-07-08 09:57:31 +08:00
Wesley Liddick
f4e8bec54c
Merge pull request #3803 from fengshao1227/fix/sidebar-scroll-position-persist
...
fix(frontend): 路由切换后保持侧边栏滚动位置
2026-07-08 09:53:05 +08:00
Wesley Liddick
6631cbad67
Merge pull request #3812 from Wei-Shaw/refactor/split-bloated-files-r2
...
refactor: 纯移动拆分 8 个后端大文件与 i18n 语言包
2026-07-08 09:03:44 +08:00
shaw
d0bcaa8b09
test(i18n): 新增语言包 spread 组装键冲突守卫测试
2026-07-08 08:49:23 +08:00
shaw
bb5d2e84a1
refactor(handler): 纯移动拆分 setting_handler.go(3957→468行)
2026-07-08 08:49:22 +08:00
shaw
f013bc1141
refactor(service): 纯移动拆分 admin_service.go(4409→642行)
2026-07-08 08:49:22 +08:00
shaw
2a4c28e8f5
refactor(service): 纯移动拆分 antigravity_gateway_service.go(4664→639行)
2026-07-08 08:49:22 +08:00
shaw
d0f669338b
refactor(service): 纯移动拆分 openai_ws_forwarder.go(4675→399行)
2026-07-08 08:49:21 +08:00
shaw
db3bd9971e
refactor(repository): 纯移动拆分 usage_log_repo.go(4701→212行)
2026-07-08 08:49:21 +08:00
shaw
4d23ad4bac
refactor(service): 纯移动拆分 openai_gateway_service.go(4872→1095行)
2026-07-08 08:49:21 +08:00
shaw
50043b1176
refactor(service): 纯移动拆分 setting_service.go(5471→263行)
2026-07-08 08:49:20 +08:00
shaw
084d26cbd2
refactor(service): 纯移动拆分 gateway_service.go(7294→1289行)
2026-07-08 08:49:20 +08:00
shaw
d9e514f982
refactor(i18n): 拆分 zh/en 语言包为域模块(深比较等价校验通过)
2026-07-08 08:49:19 +08:00
Wesley Liddick
317339e716
Merge pull request #3813 from Wei-Shaw/fix/bump-aws-sdk-eventstream-vuln
...
fix(deps): 升级 AWS SDK 修复 GO-2026-5764(backend-security CI 失败)
2026-07-08 08:48:20 +08:00
shaw
a4f942d8a9
fix(deps): 升级 AWS SDK 修复 govulncheck 报告的 GO-2026-5764
...
eventstream v1.7.5→v1.7.8、service/s3 v1.96.2→v1.97.3(含关联 internal 模块),
修复 EventStream 解码器 DoS 漏洞,恢复 backend-security CI。
2026-07-08 08:37:29 +08:00
Wesley Liddick
e8e234252a
Merge pull request #3807 from Wei-Shaw/refactor/gateway-cc-pipeline-and-file-split
...
refactor(gateway): 抽取 CC forwarder 公共管线并拆分两大 service 文件
2026-07-07 23:08:55 +08:00
shaw
d754be0d8e
refactor(gateway): 抽取 CC forwarder 公共管线并拆分两大 service 文件
...
PR #3802 遗留项:三个 CC forwarder(raw 直转 / responses 回退 / messages
回退)间约 85% 重复的 HTTP 管线与 SSE 循环骨架收敛到新文件
openai_gateway_cc_pipeline.go,messages / chat_completions 两条主路径中
逐字相同的错误处理块一并接入。各路径有意保留的行为差异(GLM effort
归一化、fast policy 适用范围、ClientDisconnect 语义、Grok 分支等)留在
调用方,未强行统一。
同时对两个最臃肿的网关文件做纯移动拆分(零语义变化,逐字节校验):
- openai_gateway_service.go 7821→4872 行:
调度 → openai_gateway_scheduling.go
passthrough → openai_gateway_passthrough.go
用量/计费/codex 快照 → openai_gateway_usage.go
- gateway_service.go 10912→7294 行:
调度 → gateway_scheduling.go
Anthropic APIKey 直通 → gateway_anthropic_passthrough.go
Bedrock → gateway_bedrock.go
回归保障:全部搬迁块与 HEAD 逐字节 diff 一致;留存文件经"HEAD 减去搬迁
范围"重构比对,差异仅为 goimports 移除的孤儿 import;定向单测
(fallback/raw/cyber/grok/transport/调度/用量/广域 Forward-Handle 扫描)
全绿;另经独立对抗审计确认零行为差异。
2026-07-07 22:14:46 +08:00
Wesley Liddick
f68f3b86c6
Merge pull request #3802 from Wei-Shaw/fix/messages-chat-fallback-hardening
...
fix(messages): 修复 /v1/messages CC 回退的错误处理旁路并补齐流式测试
2026-07-07 21:07:29 +08:00
shaw
dad92488e5
fix(messages): 修复 /v1/messages CC 回退的错误处理旁路并补齐流式测试
...
针对 #3795 合并后审计发现的问题:
- 非 failover 上游错误分支改走共享 handleAnthropicErrorResponse:恢复
ops 上游错误记录、错误透传规则、cyber_policy 检测与按状态码映射的
错误 type(400→invalid_request_error 等);删除随之失效的
mapUpstreamStatusToAnthropicStatus
- 流式读错误对齐 forwardResponsesViaRawChatCompletions:scanner 出错时
不再 finalize(不再补发 message_stop 把截断伪装成正常完成),返回
stream usage incomplete 错误
- sawDone 由死变量改为与兄弟一致的无 [DONE] 哨兵 debug 日志
- 补充 fast policy 在本路径有意省略的说明注释
- 新增 8 个单测:流式收尾闭块、tool_call 分片聚合、length→max_tokens、
空流补帧、非 failover 400 走共享处理器、读错误不伪造收尾、
Responses 账号门控回归、非流式转换
2026-07-07 20:59:41 +08:00
Wesley Liddick
4bcb13f77f
Merge pull request #3786 from creamtea47/codex/openai-fast-force-priority
...
add force priority fast policy action
2026-07-07 20:45:45 +08:00
Wesley Liddick
9643382bd3
Merge pull request #3795 from fengshao1227/fix/messages-inbound-chat-completions-fallback
...
fix(messages): /v1/messages 入站支持不兼容 Responses API 的 OpenAI 上游
2026-07-07 20:45:14 +08:00
Wesley Liddick
af4b75a77c
Merge pull request #3794 from fengshao1227/fix/image-gen-namespace-permission-bypass
...
fix(image): 识别 Codex namespace image_gen 工具声明以拦截生图请求
2026-07-07 20:42:43 +08:00
Wesley Liddick
c7249a54ac
Merge pull request #3793 from heathermhuang/codex/grok-video-text-fallback
...
fix: route text-only Grok video 1.5 requests
2026-07-07 20:22:44 +08:00
Wesley Liddick
65ff800362
Merge pull request #3799 from Wei-Shaw/fix/batch-image-audit-hardening
...
fix(batch-image): 修复审计发现的计费死锁、状态机与队列原子性缺陷
2026-07-07 20:20:49 +08:00
shaw
b5604afd3d
test(batch-image): 集成测试适配 ReplaceBatchImageItemsForJob 的 indexing 状态守卫
...
守卫要求 job 处于 indexing 状态才允许重建 item 表;原测试在 created
状态下直接调用被 409 拒绝。改为先断言非 indexing 状态的冲突行为,
再经 created→submitted→indexing 合法链推进后执行原有断言。
2026-07-07 20:13:28 +08:00
shaw
80a229bce5
fix(batch-image): 修复审计发现的计费死锁、状态机与队列原子性缺陷
...
修复 PR #3768 批量图像 MVP 合并后审计报告中的全部问题:
结算与计费(高危):
- 所有 SETTLEMENT_* 失败(超冻结/计数非法/manifest 冲突/定价缺失/扣费失败)
统一计入 retry_count 并在耗尽时释放冻结转 failed,消灭 settling 无限
requeue 导致的冻结余额永久锁死
- 耗尽出口的释放指纹统一为 RequestHash,与 processor/Cancel/recovery 一致;
release 遇同 request id 指纹冲突视为幂等成功,治愈历史毒消息
- 管理端校验 hold_multiplier >= discount_multiplier,定价快照对存量脏数据钳制
- 释放前校验 per-job hold claim(dedup+归档表),杜绝幻影释放
索引对账(高危):
- provider 输出与提交 custom_id 集对账:未知条目丢弃并记事件,
漏项补 PROVIDER_RESULT_MISSING 失败行,保证 success+fail == item_count
提交与恢复(高危):
- 提交前转 uploading 并在 provider.Submit 期间心跳刷新 updated_at;
恢复扫描改为原子复核(FailStaleUnsubmittedBatchImageJob),
消灭慢提交被误杀退款而上游任务照常计费的孤儿场景
- 上游任务创建成功但本地状态推进失败时,尽力取消上游并清理输入
- recovery 释放失败时入队交由 worker releaseTerminalHold 兜底重试
队列与并发(中危):
- Enqueue(SetNX+LPush)与 Reserve(BRPop+ZAdd)均改为 Lua 原子脚本,
消灭崩溃窗口导致 job 脱离队列、被 7 天 inflight 键锁死
- 锁冲突按 LockConflictDelay 重新入队(原直接丢弃需等 10 分钟 stale 恢复)
- 处理期间心跳:active zset 续期(ZAddXX 防幽灵成员)+ 锁 TTL 续期
- ReplaceBatchImageItemsForJob 增加 indexing 状态守卫,防掉队 worker 重写账目
存量回归(中危):
- image-only 定价条目(仅图片价无 token 价)恢复 token 计费 fail-closed,
不再按 $0 计费;图片计费路径不受影响
- 鉴权余额门槛恢复 balance <= 0 语义,MinimumBalanceReserve 不再作硬 403
加固:
- ZIP max_items 钳制到管理员上限;Submit 补齐 Platform==Gemini 校验;
gemini downloadUri 跟随前做 host 白名单校验
- 批量客户端改用共享 httpclient(拨号/TLS/响应头超时有界)
- 审计点名的忽略错误(MarkDownloaded/SettlementFailed/AppendEvent 等)改为记日志
2026-07-07 18:53:56 +08:00
Wesley Liddick
44ab690a01
Merge pull request #3768 from Turtle-Li/feature/batch-image-foundation
...
feat: add batch image generation MVP
2026-07-07 16:32:45 +08:00
Wesley Liddick
17d991786b
Merge pull request #3788 from fengshao1227/fix/codex-function-call-item-id
...
fix(codex): 剥离续链 function_call item 的非法 item_* id
2026-07-07 16:22:01 +08:00
shaw
17b6481f8b
chore: update sponsors
2026-07-07 15:44:28 +08:00
shaw
156e17335f
chore: update sponsors
2026-07-07 15:15:52 +08:00
Wesley Liddick
b5b0ea3460
Merge pull request #3708 from sweetcornna/fix/antigravity-401-self-heal
...
fix(antigravity): 网关转发默认走生产端点(修复一请求就 401/502、账号被 benched)
2026-07-07 15:12:29 +08:00
Wesley Liddick
87bdaf8e60
Merge pull request #3780 from fengshao1227/fix/gateway-parse-error-observability
...
fix(gateway): 记录请求体解析失败的真实原因,不再吞错
2026-07-07 14:37:46 +08:00
Wesley Liddick
a98397adbb
Merge pull request #3778 from fengshao1227/fix/websearch-emulation-history-blocks
...
fix(websearch): 剥离历史消息中上游不接受的 web search 块
2026-07-07 14:33:16 +08:00
Wesley Liddick
aff87d9497
Merge pull request #3776 from alfadb/fix/openai-compact-usage-sse-detection
...
fix(openai): 避免 JSON 响应被 SSE 文本误判导致用量丢失
2026-07-07 14:31:52 +08:00
Wesley Liddick
571e0b8132
Merge pull request #3774 from heathermhuang/codex/grok-composer-image-bridge
...
fix: bridge Grok Composer image inputs
2026-07-07 14:13:28 +08:00
Wesley Liddick
d7a6a4513a
Merge pull request #3729 from starmiaoa/feat/account-import-dnd-batch-20260705
...
支持账号数据拖拽和批量导入
2026-07-07 10:44:39 +08:00
Wesley Liddick
baadb22682
Merge pull request #3761 from alfadb/fix/responses-alias-normalization
...
修复 OpenAI Responses compact 端点归一化
2026-07-07 10:37:08 +08:00
Wesley Liddick
863953321e
Merge pull request #3771 from Wei-Shaw/fix/redis-scan-index-hardening
...
fix(redis-index): 加固 #3762 引入的索引驱动清理架构
2026-07-07 10:21:17 +08:00
shaw
7650cce5a4
fix(redis-index): harden index-driven cleanup introduced in #3762
...
- 启动清理覆盖 score 已过期的索引成员,并新增 marker 门控的一次性
遗留 wait 键清扫,消除重启后幻影等待计数挤占 maxWait 的问题
- UMQ 争锁失败路径回填观测到的持有者锁索引(PTTL=-1 异常锁以已到期
候选入索引),恢复被 SCAN 删除后丢失的孤儿锁兜底完整性
- 后台清理同时回收 account 与 user 两个活跃索引的到期候选,修复
user 索引过期成员无回收路径导致的无界增长
- acquire/incrementWait Lua 脚本返回 {result, now},索引写复用脚本
内 Redis 时间,热路径每次操作减少一次 TIME 往返;清理循环外提
now 并批量写索引
- 删除无生产调用方的 GetActiveAccountLoadMap 及配套死代码
- 索引维护失败增加 warn 日志,不再静默丢弃
- 移除根目录工单文档 REDIS_SCAN_ARCHITECTURE_OPTIMIZATION.md
2026-07-07 10:04:38 +08:00
Wesley Liddick
db9d92ba8f
Merge pull request #3762 from jianjianai/fix/add-chinese-comments
...
优化 Redis SCAN 清理架构
2026-07-07 09:36:20 +08:00
shaw
7c8e13208b
style: replace interface{} with any per golangci-lint gofmt rewrite rules
2026-07-07 09:32:15 +08:00
shaw
d37d216f9d
Merge remote-tracking branch 'origin/main' into pr-3762
...
# Conflicts:
# backend/internal/repository/concurrency_cache.go
# backend/internal/repository/concurrency_cache_integration_test.go
2026-07-07 09:22:44 +08:00
Wesley Liddick
96f3697ecb
Merge pull request #3767 from qqqianye/fix/admin-account-compact-probe
...
fix(frontend): add compact probe mode to admin account test modal
2026-07-07 09:09:05 +08:00
shaw
a564051f83
chore: renew expired xlsx audit exceptions to 2026-10-06
...
xlsx is frozen at 0.18.5 on the npm registry (fixed versions are only
published on the SheetJS CDN), so GHSA-4r6h-8v6p-xvw6 and
GHSA-5pgg-2g8v-p4x9 remain flagged by pnpm audit. Mitigation is
unchanged: admin-export-only usage behind a dynamic import.
2026-07-07 08:38:30 +08:00
Wesley Liddick
a862eac1d8
Merge pull request #3758 from catoncat/fix/test-oauth-codex-headers
...
fix: add missing Codex CLI headers for OAuth account test
2026-07-07 08:34:18 +08:00
Wesley Liddick
913d838770
Merge pull request #3755 from wucm667/fix/subscription-usd-cny-rate-opt-in
...
feat(payment): 套餐编辑页展示订阅 CNY 实扣预览
2026-07-07 08:29:12 +08:00
Wesley Liddick
3828a48752
Merge pull request #3751 from heathermhuang/codex/grok-image-pricing-latest
...
fix: expose Grok image pricing controls
2026-07-07 08:29:01 +08:00
Wesley Liddick
77b1a0452e
Merge pull request #3760 from DaydreamCoding/fix/codex-detect-version-gate-message
...
fix(codex-detect): codex 版本门拒绝返回带版本号的差异化文案
2026-07-07 08:28:51 +08:00
Wesley Liddick
26b51ccfd3
Merge pull request #3737 from wucm667/fix/sync-models-non-v1-base-url
...
fix(models): 同步上游模型支持非 /v1 API 版本 base_url(如智谱 /v4)
2026-07-07 08:28:41 +08:00
Wesley Liddick
67e945f8e8
Merge pull request #3759 from Wei-Shaw/feat/account-header-override
...
feat: apikey 账号支持请求头覆写(Anthropic/OpenAI)
2026-07-06 20:47:33 +08:00
shaw
31b6e0d94a
fix: 请求头覆写审计问题修复(禁止名单缺口/beta 对称性/批量清空防护)
...
后端:
- 禁止名单补充 content-type(multipart boundary 为每请求随机值,静态覆写必坏
images 路径)、x-claude-code-session-id / x-client-request-id(会击穿每请求
会话同步,与已禁的 session_id 等同类)、cookie / x-goog-api-key(与透传路径
的入站鉴权残留清洗保持一致)
- anthropic-beta 覆写与 body 净化对称:四个 Anthropic 构建器在
sanitizeAnthropicBodyForBetaTokens 前以覆写值为有效 finalBeta,避免覆写
丢 token 后 header/body 不对称被上游 400
- 保存/应用两路径共用 normalizeHeaderOverrideEntry,消除双份校验规则漂移
- GetHeaderOverrides 按 modelMappingCache 先例增加热路径缓存(WS 每消息
重建头场景收益最大);ApplyHeaderOverrides 移除无观测效果的排序
前端:
- 禁止名单镜像同步新增项;值长度改按 UTF-8 字节校验(与后端 len() 对齐)
- Create 弹窗切换平台时重置覆写配置,避免上一平台模板行串台
- BulkEdit:开启覆写但无有效行时拦截保存(防止整键替换静默清空所选账号
既有配置);开启分支显示整体替换警告;混合平台选择时隐藏模板按钮
- 删除未使用的 isBlockedHeaderOverrideName 导出
2026-07-06 20:05:50 +08:00
shaw
ec7b20649e
feat: apikey 账号支持请求头覆写(Anthropic/OpenAI)
...
- 账号 credentials 新增 header_override_enabled / header_overrides,
仅对 anthropic/openai 平台的 api_key 账号生效
- 转发前对同名请求头做大小写不敏感覆盖(EqualFold 全量删除后按
wire casing 写入单值),值为空的条目视为占位不参与覆盖
- 覆盖全部出站路径:/v1/messages(标准+透传)、count_tokens、
/v1/responses、chat completions、embeddings、images、全部 WS 模式、
账号测试/探测、上游模型列表
- 创建/编辑/批量更新统一校验:RFC 7230 名称格式、去重、长度/条目上限、
24 个禁止覆写头(认证/连接控制/accept-encoding/sec-websocket-*/
会话隔离头),应用时二次防御过滤
- 前端三个账号弹窗新增开关+键值行编辑器+模板按钮(Claude Code CLI /
Codex CLI 标准头,值为空),本地校验与后端规则对齐,i18n 中英文
2026-07-06 19:11:08 +08:00
shaw
6cea1c35bb
feat: 适配 OpenAI 新模型 gpt-5.6-sol/terra/luna
2026-07-06 17:34:22 +08:00
Wesley Liddick
d1d3400b69
Merge pull request #3645 from bestony/worktree/lucky-harbor-dbe4
...
feat(keys): add api key concurrency stats
2026-07-06 16:45:15 +08:00
Wesley Liddick
3fa08aa930
Merge pull request #3749 from moonfunjohn/codex/easypay-custom-methods
...
EasyPay custom visible payment methods
2026-07-06 16:06:59 +08:00
Wesley Liddick
2854ab2ace
Merge pull request #3744 from Wei-Shaw/fix/subscription-cny-optin-rate
...
fix(payment): 订阅 CNY 换算改为独立汇率配置的显式 opt-in(含 #3738)
2026-07-06 14:58:20 +08:00
Wesley Liddick
e95c909ee5
Merge pull request #3747 from Wei-Shaw/revert-3738-fix/subscription-confirm-amount-and-affiliate-base
...
Revert "fix(payment): 订阅确认页显示换算后 CNY 金额 + 邀请返利按 USD price 计算"
2026-07-06 14:58:00 +08:00
Wesley Liddick
11fd61458c
Merge pull request #3738 from wucm667/fix/subscription-confirm-amount-and-affiliate-base
...
fix(payment): 订阅确认页显示换算后 CNY 金额 + 邀请返利按 USD price 计算
2026-07-06 14:53:59 +08:00
shaw
d56e94b875
feat(payment): 订阅 CNY 换算改为独立汇率配置的显式 opt-in
...
- 新增 SUBSCRIPTION_USD_TO_CNY_RATE 配置(1 USD = X CNY,默认 0=关闭),
替代复用 balance_recharge_multiplier 的隐式换算,促销倍率与订阅定价解耦
- 未配置汇率时订阅保持 price 直付的存量行为,存量部署升级零影响
- 前端确认页/原价/手续费/方式限额与后端换算条件严格镜像(rate>0 且币种为 CNY)
- 管理后台新增汇率配置输入(zh/en 文案),checkout-info 透出 subscription_usd_to_cny_rate
- 单测锁定:汇率未配置时不换算、换算使用汇率而非余额倍率、余额订单不受影响、返利仍按 USD price
2026-07-06 14:34:17 +08:00
shaw
d089c5789c
Merge branch 'pr-3738' into fix/subscription-cny-optin-rate
2026-07-06 14:14:19 +08:00
Wesley Liddick
9fac6f15ce
Merge pull request #3739 from Wei-Shaw/fix/openai-advanced-scheduler-audit-fixes
...
fix(scheduler): 修复 OpenAI 高级调度器审计发现的正确性与性能问题
2026-07-06 13:45:15 +08:00
shaw
0fd2e9216d
fix(scheduler): 修复 OpenAI 高级调度器审计发现的正确性与性能问题
...
针对 #3692 合并后审计发现的问题集中修复:
- previous_response_id 剥离条件改为按 call_id 全覆盖校验,
部分可重建的工具续链不再被误剥离(不受开关门控的行为回归)
- 粘性加权回退路径补分组归属校验并清理失效绑定,杜绝跨分组账号泄漏
- 账号列表页:无 OpenAI 账号时跳过分数计算、过滤池限定 openai 平台、
负载批查合并为账号并集一次查询,消除全表扫描与 Redis N+1
- 订阅优先模式下常规池不可用时回退订阅池等待计划,
busy-but-waitable 的订阅账号不再导致请求硬失败
- TopK/权重 DB 覆盖显式受总开关门控,与兄弟子开关语义一致
- 前端未分组 OpenAI 账号回退展示基础分,不再显示 "-"
- ListAllWithFilters 等能力正式进入 AccountRepository/AdminService 接口,
移除匿名接口断言与静默降级;负载批查失败补 warn 日志
- SelectAccountWithSchedulerForCapability 增加显式 previousResponseCanMove
参数,移除 "previous_response_can_move" 魔法字符串哨兵
- 设置写入路径补"基础权重不得全为零"聚合校验;
运行时设置批量读取失败的降级路径覆盖全部键并留痕
2026-07-06 11:43:16 +08:00
Wesley Liddick
759332aa92
Merge pull request #3692 from linshuboy/codex/openai-advanced-scheduler-controls-squashed
...
[codex] add OpenAI advanced scheduler controls
2026-07-06 10:59:23 +08:00
Wesley Liddick
f0f1f59a44
Merge pull request #3716 from wucm667/fix/antigravity-refresh-server-invalidated-token
...
fix(antigravity): 401 服务端失效的 token 触发主动刷新,修复 NeedsRefresh 仅看 expires_at 的死循环
2026-07-06 10:18:49 +08:00
Wesley Liddick
ac68d73f0c
Merge pull request #3717 from wucm667/fix/anthropic-models-honor-group-config
...
fix(gateway): Anthropic /v1/models 返回分组 models_list_config 自定义模型列表
2026-07-06 10:18:36 +08:00
Wesley Liddick
2e70ec0a15
Merge pull request #3714 from MoRanHuiShou-pug/fix-payment-nul-bytes
...
fix: sanitize payment response NUL bytes
2026-07-06 10:18:18 +08:00
Wesley Liddick
de15f29d1f
Merge pull request #3718 from wucm667/fix/usage-csv-export-utf8-bom
...
fix(usage): CSV 导出补 UTF-8 BOM,修复 Excel 打开中文列乱码
2026-07-06 10:12:27 +08:00
Wesley Liddick
809e1cf8ee
Merge pull request #3704 from feitianbubu/feat/sidebar-logo-home-link
...
feat: 点击侧边栏 Logo/站点名返回首页
2026-07-06 10:12:15 +08:00
Wesley Liddick
c9dda3c01f
Merge pull request #3734 from Yinr/patch-1
...
fix(i18n): correct misleading "irreversible" description for revoke action
2026-07-06 10:12:04 +08:00
shaw
6752cdc826
fix(i18n): 用量页费用明细提示将面向用户的"成本"措辞统一为"费用"
...
用户 /usage 页费用列悬浮提示中的成本明细/输入成本/输出成本/
缓存创建成本/缓存读取成本/图片输出成本 改为对应的"费用"表述;
成本是运营方视角的词,面向用户应称费用。管理端真正的账号成本
词条(accountCost 等)保持不变。
2026-07-06 09:36:21 +08:00
shaw
498f010ec3
fix(部署): 统一 Docker 部署 URL 安全默认值为开发友好模式
...
docker-compose.yml / docker-compose.local.yml 中
SECURITY_URL_ALLOWLIST_ALLOW_INSECURE_HTTP 与
SECURITY_URL_ALLOWLIST_ALLOW_PRIVATE_HOSTS 的兜底值由 false 改为 true,
与代码默认值(0c7a58fc)保持一致,避免未配置 .env 的 Docker 部署
在测试账号连接时因 http base URL 报 "invalid url scheme: http"。
同步更新 README(三语)、.env.example、config.example.yaml 中
过时的"默认拒绝 HTTP"描述,改为默认允许并指导生产环境显式收紧。
2026-07-04 13:51:37 +08:00
Wesley Liddick
41def4ba03
Merge pull request #3699 from wucm667/fix/responses-billing-use-mapped-model
...
fix(openai): /v1/responses 计费使用映射后模型,修复按原始模型价格误计费
2026-07-04 10:40:53 +08:00
Wesley Liddick
707b87a96f
Merge pull request #3676 from wucm667/fix/codex-import-refresh-token-missing-collision
...
fix(admin): Codex Session 导入 refresh_token 缺失时不再合并同 workspace 不同账号
2026-07-04 10:29:47 +08:00
shaw
cbe0c4665f
chore: update readme
2026-07-04 10:18:41 +08:00
shaw
dec709fb3a
chore: update sponsors
2026-07-04 10:06:11 +08:00
shaw
be297b90ce
refactor(frontend): merge Codex image bridge and tool policy into one four-state control
...
Replace the two adjacent account-level controls (3-state injection bridge
+ 2-state explicit tool policy) in EditAccountModal with a single
four-state selector: follow channel / force inject / no injection /
block all. The four states map onto the existing extra keys
(codex_image_generation_bridge, codex_image_generation_explicit_tool_policy)
with no backend change; strip already disables the bridge upstream, so
the effective decision space is exactly these four states.
- load: strip takes precedence and reads as "block all"; legacy
bridge_enabled key still recognized and cleaned up on save
- save: block writes policy=strip and drops the bridge override;
inherit clears both keys
- semantic accent colors per state (sky/emerald/amber/rose) with dark
mode support; state badge follows the same palette
- replace account-scope i18n keys in zh/en (channel-scope keys untouched)
- rewrite specs to cover all four states (25/25 passing)
2026-07-04 09:49:37 +08:00
Wesley Liddick
dfdb838ce4
Merge pull request #3690 from AndersonBY/feature/codex-image-tool-policy
...
feat: add Codex image tool strip policy
2026-07-04 09:27:37 +08:00
Wesley Liddick
be3aee1a4b
Merge pull request #3694 from zhaoteng45/fix/antigravity-gemini31-pro-agent
...
fix: normalize Antigravity Gemini 3.1 Pro routing
2026-07-04 09:23:46 +08:00
Wesley Liddick
588e02b29e
Merge pull request #3673 from heathermhuang/codex/grok-admin-issues-3545-3649
...
fix: preserve configured Grok OAuth concurrency
2026-07-04 09:22:18 +08:00
Wesley Liddick
659086861d
Merge pull request #3670 from weiness/feat/configurable-migration-timeout
...
feat: make setup migration timeout configurable
2026-07-04 09:21:14 +08:00
Wesley Liddick
0c53d4f334
Merge pull request #3661 from jianjianai/fix/group-capacity-batch-hotpath
...
fix: 优化用户组容量汇总批量统计性能
2026-07-04 09:20:02 +08:00
Wesley Liddick
8e07ec55db
Merge pull request #3685 from jianjianai/fix/optimize-slot-cleanup
...
fix: 优化并发槽位定时清理性能
2026-07-04 09:19:34 +08:00
Wesley Liddick
129d05258a
Merge pull request #3696 from jianjianai/codex/token-expired-nonretryable
...
fix:添加 token_expired 刷新不可重试判断
2026-07-04 09:18:43 +08:00
Wesley Liddick
46ef146225
Merge pull request #3689 from DaydreamCoding/feat/usage-error-requests-alignment
...
feat(usage): 错误请求对齐用量明细(UI/排序/筛选/列设置)
2026-07-04 09:18:08 +08:00
Wesley Liddick
35df02aeac
Merge pull request #3698 from Wei-Shaw/feat/anthropic-7d-oi-fable-model-rate-limit
...
feat(anthropic): 7d_oi(Fable 专属 7d 窗口)429 仅做模型级限流 + 用量窗口新增 7d F 进度条
2026-07-04 08:49:08 +08:00
shaw
b3f796972e
feat(anthropic): treat 7d_oi (Fable) window 429 as model-level rate limit
...
Anthropic OAuth/setup-token accounts now expose a Fable-only 7d window in
429 responses (anthropic-ratelimit-unified-7d_oi-*). Previously, a 429
triggered solely by this window fell through to the legacy path and marked
the whole account rate limited (picking the sooner 5h/7d reset) even though
5h/7d were still "allowed".
Backend:
- HandleUpstreamError: when only 7d_oi is rejected/exceeded, set a
model-level rate limit (scope "claude-fable-5") and skip account-level
SetRateLimited / session-window rewrite / temp-unsched entirely.
Real 5h/7d exhaustion keeps the exact legacy account-level behavior.
- modelRateLimitKeysForRequest: append the Fable family scope for any
mapped Anthropic model containing "fable", so claude-fable-5[1m] and
other variants are excluded from scheduling together.
- Passive sampling: collect 7d_oi utilization/reset into Extra
(passive_usage_7d_oi_*), including from the 429 response itself so the
usage bar doesn't freeze at a stale value during the limit window;
cleared on 5h window reset like the existing 7d keys.
- Usage API: new seven_day_fable window in UsageInfo. GetPassiveUsage
builds it from passive samples; active queries parse the upstream
seven_day_overage_included field (claim name from the
representative-claim header) and fall back to passive data when the
upstream usage API doesn't return it, so the active-query button keeps
the bar populated. seven_day_sonnet handling is preserved unchanged.
Frontend:
- /admin/accounts usage cell renders a "7d F" (amber) progress bar next to
the existing 5h / 7d / 7d S bars for Anthropic OAuth/setup-token accounts.
2026-07-04 08:28:30 +08:00
Wesley Liddick
2649573b99
Merge pull request #3684 from Wei-Shaw/fix/usage-log-queue-silent-drop
...
fix: prevent silent usage_logs drops under queue overflow
2026-07-03 22:17:24 +08:00
shaw
a1b2b32e08
fix: prevent silent usage_logs drops under queue overflow ( #3656 )
...
高并发下扣费成功但 usage_logs 被双层异步队列静默丢弃(单用户实测丢失 49%),
导致消费排行与对账缺口。根因是 6a685727 为避免溢出时单行 INSERT 踩踏数据库,
把三处"队列满"改成了立即终态丢弃。
改为有界阻塞背压,兼顾数据不丢与批量写入模式不变:
- CreateBestEffort/createBatched 入队移除 default 立即丢弃分支,
队列满时阻塞等待(受 detached 15s ctx 期限约束)
- writeUsageLogBestEffort 收到 dropped 不再直接放弃,统一走
repo.Create 同步兜底(仍经批处理器;ctx 耗尽时换新 detached 窗口),
重复写入由 ON CONFLICT DO NOTHING 幂等防护
- worker 池默认溢出策略 sample→sync(viper 默认 + 池常量),
溢出时提交方内联执行(提交点在响应写出后,不阻塞客户端),
显式配置 sample/drop 的部署不受影响
- 附带修复 ensure*Batcher 的存量数据竞争:channel nil 检查移入 sync.Once
正常负载零行为变化;突发时短暂等待替代永久丢失;数据库只见批量 INSERT。
2026-07-03 21:02:32 +08:00
Wesley Liddick
28c2d20d9f
Merge pull request #3675 from wucm667/fix/antigravity-401-auto-recover
...
fix(antigravity): 401 认证失败可自动恢复,不再永久卡在 error 状态
2026-07-03 16:58:37 +08:00
Wesley Liddick
87dfc66132
Merge pull request #3659 from jianjianai/fix/ops-realtime-stats-performance
...
fix: 优化运维实时账号统计接口性能
2026-07-03 10:45:24 +08:00
Wesley Liddick
5d7f213cbf
Merge pull request #3657 from jianjianai/fix/redeem-invitation-bad-request
...
修复邀请码误走普通兑换接口时返回 500
2026-07-03 10:44:22 +08:00
shaw
a5638a4e54
fix: match Codex session imports by chatgpt_user_id before shared account id
...
Members of the same ChatGPT team share chatgpt_account_id, so matching
imports by the account key first could overwrite another member's
account credentials. Identity keys are now ordered by strength
(user > email > access > account), and an account-key hit is rejected
when both sides carry different chatgpt_user_id values.
- Keep the account-key fallback when either side lacks a user id, so
legacy accounts without chatgpt_user_id are updated and backfilled
instead of duplicated
- Index all candidate accounts per shared key so a teammate's row can
no longer shadow a legacy account depending on row order
- Apply the same conflict check to in-batch dedup and emit a warning
when a legacy account is claimed via the shared account key
- Scope a 120s timeout to the Codex session import request instead of
raising the global client timeout
2026-07-03 10:13:51 +08:00
Wesley Liddick
a32196eedd
Merge pull request #3615 from DaydreamCoding/feat/usage-ip-geolocation
...
feat(usage): add IP geolocation lookup to usage tables
2026-07-02 16:42:06 +08:00
Wesley Liddick
3302146759
Merge pull request #3643 from bestony/feat/admin-group-column-settings
...
feat(admin): add group column settings
2026-07-02 16:40:59 +08:00
shaw
41af8e8e11
chore: update sponsors
2026-07-02 16:29:34 +08:00
shaw
11a3da65c0
fix(group): harden peak-rate config handling and label peak windows with server timezone
...
Follow-up fixes to #3569 based on code audit:
- Expose server_timezone / server_utc_offset in public settings (and the
__APP_CONFIG__ injection payload) and label every peak-window display
with the server UTC offset, so users don't misread the billing window
as browser-local time
- Unify CreateGroup/UpdateGroup peak-config sanitization via a single
NormalizePeakRateConfig chokepoint: non-subscription groups always get
peak fields cleared; unparseable window strings and negative
multipliers are scrubbed when peak is disabled
- Replace hot-path time.Parse in PeakMultiplierAt with a manual HH:MM
parser (accept set verified byte-for-byte identical to
time.Parse("15:04") by exhaustive fuzzing) and reuse it in validation
- Revert the zero-behavior CalculateCost indirection churn in
billing_service/gateway_service introduced by #3569
- Remove dead GetGroupPlatformMap and the duplicate deref helper in the
admin handler package
- Share frontend peak formatting via utils/peak-rate.ts, unify the ×N
label format, and move hardcoded Chinese tooltips to i18n keys
2026-07-02 16:11:07 +08:00
Wesley Liddick
a632cb0050
Merge pull request #3569 from xueshiji/main
...
feat(group): 订阅分组新增可选的高峰时段倍率,以支持智谱等coding plan的高峰时段
2026-07-02 14:55:34 +08:00