jjaw
9da4cfbdcc
增加调度分组生命周期租约
2026-07-15 00:12:40 +08:00
jjaw
8523a52c07
优化调度缓存桶退休原语
2026-07-14 23:08:17 +08:00
Wesley Liddick
24d908b257
Merge pull request #4203 from jianjianai/codex/fix-scheduler-pending-lag
...
修复调度器使用已消费事件计算 outbox 延迟
2026-07-14 10:59:57 +08:00
Wesley Liddick
9c3c560d49
Merge pull request #4206 from jianjianai/codex/fix-scheduler-proxy-expiry-event
...
修复代理到期改投触发全量调度重建
2026-07-14 10:59:43 +08:00
Wesley Liddick
8711882918
Merge pull request #4205 from jianjianai/codex/fix-scheduler-auto-pause-event
...
修复账号到期暂停触发全量调度重建
2026-07-14 10:59:34 +08:00
Wesley Liddick
27fcbace89
Merge pull request #4207 from hongheshan-svg/upstream-pr/http2-keepalive
...
fix(openai): 为 Codex HTTP/2 上游启用 PING 健康探测,剔除死连接
2026-07-14 10:59:22 +08:00
shaw
d41a10111d
Merge remote-tracking branch 'origin/main' into feat/grok-sso-device-oauth
...
# Conflicts:
# frontend/src/api/admin/grok.ts
2026-07-14 10:19:16 +08:00
Wesley Liddick
93f2ccf3a5
Merge pull request #4188 from superman2003/fix/grok-free-quota-429-20260713
...
feat(grok): improve free quota probing and usage display
2026-07-14 10:14:41 +08:00
Wesley Liddick
a8927d8ec7
Merge pull request #4214 from bestony/agent/devbox-coding/25c66071-1783957460
...
feat: add opt-in Server-Timing for Admin UI APIs
2026-07-14 10:14:17 +08:00
Wesley Liddick
41c71a1528
Merge pull request #4216 from bestony/agent/devbox-coding/3ff3c99d
...
feat(ops): add Host filtering to system logs
2026-07-14 10:13:40 +08:00
jjaw
9033e14bb7
修复账号到期暂停触发全量重建
2026-07-14 09:49:57 +08:00
jjaw
8f328d4ab3
修复代理到期改投触发全量重建
2026-07-14 09:23:02 +08:00
bestony and multica-agent
2c2e50ba58
feat(ops): add host filtering to system logs
...
Co-authored-by: multica-agent <github@multica.ai >
2026-07-14 01:29:46 +08:00
bestony and multica-agent
966afd1b4b
fix: preserve instrumented client contracts
...
Co-authored-by: multica-agent <github@multica.ai >
2026-07-14 01:29:30 +08:00
bestony and multica-agent
54d228dda5
feat(admin): add opt-in server timing metrics
...
Co-authored-by: multica-agent <github@multica.ai >
2026-07-14 01:29:30 +08:00
jinfeijie bot
ad4bf5c60d
feat(grok): 支持 Web SSO 批量导入并转换为 Build OAuth
...
新增 Grok Web SSO → xAI Device Flow → Grok Build OAuth 导入链路,
支持管理员批量粘贴 SSO key 创建 OAuth 账号。
- 后端:ConvertSSOToBuild、ConvertFromSSO、POST /admin/grok/sso-to-oauth
- 批量:3 worker 并发,失败跳过并汇总 created/failed,worker panic recover
- 无 refresh_token 时写入 expires_at 并强制 auto_pause_on_expired
- 前端:SSO Cookie 导入入口、动态超时、中英文案、部分成功不关弹窗
- 测试:pkg/service/handler/前端超时单测;本地 Docker 真实 SSO e2e 通过
2026-07-14 01:09:07 +08:00
benjamin
e9fb5983cd
fix(billing): 默认关闭 OpenAI 长上下文计费
2026-07-13 23:32:16 +08:00
hongheshan-svg and Claude Opus 4.8
98027cdded
fix(openai): enable HTTP/2 keep-alive PING to evict dead Codex connections
...
Codex/OpenAI upstream switched from a WebSocket pool to HTTP/2. The
outbound H2 transport set neither ReadIdleTimeout nor ResponseHeaderTimeout
(the OpenAI profile forces ResponseHeaderTimeout=0), so a pooled H2
connection silently killed by a proxy/NAT becomes a "dead connection":
both ends believe it is alive and a request assigned to it hangs until the
OS TCP retransmit timeout (minutes) before the first byte — observed as an
8m37s TTFT with an eventual 200. Occasional (only when a request lands on a
dead pooled conn) and across all groups (shared OpenAI transport); worse on
larger idle pools.
Explicitly configure http2 on the openai_h2 transport and enable active
PING health checks (ReadIdleTimeout=15s, PingTimeout=15s) so dead
connections are detected and evicted at the source, instead of relying on
ResponseHeaderTimeout as an after-the-fact backstop. Scoped to the
openai_h2 path only; Claude/Gemini (default) and h1 modes are untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-07-13 23:31:18 +08:00
jjaw
a0778e9a42
修复调度器使用已消费事件计算延迟
2026-07-13 21:56:47 +08:00
superman2003
c896cacf6d
feat(grok): improve free quota probing and usage
2026-07-13 19:49:56 +08:00
benjamin
3e4d48e010
Merge remote-tracking branch 'upstream/main' into fix/api-double-billing
...
# Conflicts:
# frontend/src/components/account/EditAccountModal.vue
2026-07-13 18:06:44 +08:00
benjamin
a0ac5e0240
fix(billing): 默认开启 OpenAI 长上下文计费
2026-07-13 17:55:01 +08:00
Bestony@Homelab
c8cfc93632
fix(openai-ws): bound ingress session lifecycle
2026-07-13 15:32:42 +08:00
Wesley Liddick
baab0adf7c
Merge pull request #4075 from jianjianai/codex/fix-scheduler-cache-invalid-time-upstream
...
fix(scheduler): skip cache records with unencodable times
2026-07-13 14:42:05 +08:00
Wesley Liddick
90bff0ea17
Merge pull request #4050 from bestony/perf/keys-last-used-ip-query
...
perf(keys): bound latest IP lookup per key
2026-07-13 14:13:11 +08:00
benjamin
0d9c140bc2
Merge upstream/main into fix/api-double-billing
2026-07-13 11:10:33 +08:00
Wesley Liddick
b73d8c3efe
Merge pull request #4009 from heathermhuang/codex/fix-recent-grok-issues
...
fix: expand Grok API, CLI, billing, and setup support
2026-07-13 10:36:11 +08:00
shaw
64a2a31729
fix(billing): 修复复审发现的三处按次计费问题
...
- HIGH: GetByKeyForAuth 的 WithGroup 显式 Select 补 web_search_price_per_call 列,
否则 auth 快照里分组覆盖价恒为 nil,覆盖价/免费配置在实际计费中静默失效
- MEDIUM: 按次搜索倍率改用不含高峰因子的基础倍率(与 image/video 按次不变式
及分组表单价格预览承诺一致),calculateOpenAIRecordUsageCost 新增独立倍率参数
- LOW: 计费门槛从 <400 收紧为严格 2xx,1xx/3xx 透传不计费
2026-07-13 10:14:53 +08:00
Heatherm Huang
c4ff604e93
test(grok): cover OAuth chat permission identity
2026-07-13 10:11:33 +08:00
Heatherm Huang
ce3f12bbff
test(grok): cover CLI identity at transport boundary
2026-07-13 10:11:33 +08:00
Heatherm Huang
f187f08ae3
fix(grok): harden OAuth routing and CLI version guard
2026-07-13 10:11:33 +08:00
Heatherm Huang
038b25c0b1
fix(grok): resolve recent integration issues
2026-07-13 10:09:53 +08:00
shaw
7cbb36f278
feat(billing): Codex alpha/search 网页搜索按次计费
...
- alpha/search 成功请求(上游 2xx)按次计费落 usage_logs(billing_mode=per_request),
上游错误透传/failover 不计费;使用 mandatory 池提交,池满同步兜底不丢扣费
- 单价默认 0.01 USD/次(官方 $10/1000 次),分组新增 web_search_price_per_call
覆盖价(0=免费,负数/留空=默认价),实际扣费叠加分组费率倍数(与 token 口径一致)
- 分组字段全链路:ent schema + 迁移 174 + 端口快照 v15 + admin 创建/更新 + DTO
- 前端分组表单(openai 平台)新增单次价格配置,实时预览应用当前倍率后的单次价格
- 该端点鉴权维持仅 OpenAI 分组(非 OpenAI 分组 404)
2026-07-13 09:54:51 +08:00
benjamin
92dcfb5ebc
fix(billing): 按账号控制 OpenAI 长上下文计费
2026-07-13 09:47:19 +08:00
jjaw
fe184f8c33
修复调度缓存异常时间阻塞
...
Refs Wei-Shaw/sub2api#60
Refs Wei-Shaw/sub2api#1608
2026-07-12 05:54:46 +08:00
superman2003
1dedb2097d
fix(grok): persist quota exhaustion as rate limit
2026-07-11 20:41:32 +08:00
Bestony
1c02158c2a
perf(migrations): index latest API key IP lookups
2026-07-11 17:32:06 +08:00
Bestony
80b7a8d4cb
perf(keys): bound latest IP lookup per key
2026-07-11 17:31:30 +08:00
Wesley Liddick
6dd3274aaf
Merge pull request #3948 from superman2003/fix/gpt56-billing-usage-integrity
...
fix(openai): correct GPT-5.6 billing and usage gaps
2026-07-10 15:45:18 +08:00
Wesley Liddick
6a2063b374
Merge pull request #3883 from ShuminFu/fix/setup-token-auto-refresh
...
fix: 后台自动刷新纳入 setup-token 账号(修复 8h 后 401)
2026-07-10 15:44:54 +08:00
superman2003
de28eba3c8
fix(openai): harden GPT-5.6 billing and usage
2026-07-10 15:13:11 +08:00
Shumin
a495d5e302
test: 更新断言以覆盖 setup-token 纳入后台刷新
...
- ListOAuthRefreshCandidates SQL 断言由 type = 'oauth' 改为
type IN ('oauth', 'setup-token')。
- ClaudeTokenRefresher.CanRefresh 增加 anthropic setup-token → true 用例。
2026-07-10 02:27:33 -04:00
Wesley Liddick
8b96acde97
Merge pull request #3898 from Arron196/feat/gpt-5.6-cache-billing-stats
...
feat(openai): 支持 GPT-5.6 系列缓存写入计费与统计
2026-07-10 13:57:29 +08:00
superman2003
fc66a30ffc
fix: harden billing concurrency and payment recovery
2026-07-10 10:56:49 +08:00
benjamin
5c15d32ff7
test(repository): stabilize expired lock reconciliation
2026-07-10 10:18:50 +08:00
Shumin
99da308196
fix: 后台自动刷新纳入 setup-token 账号
...
setup-token 的 access_token 同为 8h 短期令牌(expires_in=28800),
此前被后台刷新服务排除,到期后请求返回 401 authentication_error。
放开 CanRefresh 与候选查询的 type='oauth' 限制,与手动刷新入口
(account.IsOAuth()) 保持一致;实际刷新仍由 NeedsRefresh 基于
expires_at 门控并在分布式锁下执行,不会过度刷新。
2026-07-09 11:05:05 -04:00
shaw
1c2e6503c6
feat: 版本徽章新增近3个历史版本在线回退与手动回退指引
...
后端:
- UpdateService 新增 ListRollbackVersions/RollbackToVersion,回退目标强制
限定为比当前版本更旧的近3个正式版本(排除当前/更新/预发布/草稿),
越界返回 400 ROLLBACK_VERSION_NOT_ALLOWED;下载复用既有 HTTPS 域名
白名单 + checksum 校验 + 原子换二进制管线
- GitHubReleaseClient 新增 FetchRecentReleases(releases 列表 API)
- 新增 GET /admin/system/rollback-versions;POST /admin/system/rollback
支持可选 {"version"} body,无 body 保持原 .backup 本地回退行为不变
- 端点均在 /admin 组 adminAuth(IsAdmin+TokenVersion)保护内
前端:
- VersionBadge「已是最新版本」状态下新增版本回退面板:radio 卡片选择
近3个版本,手动回退方式按部署形态 tab 切换(脚本部署 curl 命令 /
Docker 镜像 tag 指引),支持一键复制;release 构建提供一键回退并
复用重启流程;源码构建仅提示不支持在线回退
- 下拉根元素重置 whitespace-normal,修复 sidebar-brand 的
white-space:nowrap 继承导致的长文本溢出裁切
测试:服务层过滤/排序/上限/非法目标拒绝、handler 双模式与鉴权错误映射、
GitHub client 列表拉取、前端 API 请求体行为共 16 个新增用例
2026-07-09 22:30:04 +08:00
Wesley Liddick
10102807e2
Merge pull request #3869 from Birditch/feat/admin-user-role-and-token-ranking
...
feat(admin): 用户角色管理 + 用户 Token 排行
2026-07-09 19:50:01 +08:00
Birditch and Claude Opus 4.8
b062b36646
feat(admin): 用量记录页新增"用户 Token 排行"面板
...
- 在 /admin/usage 新增按用户聚合的 Token 排行表(输入/输出/缓存/总 Token、请求数、费用)
- 支持按列排序、邮箱搜索、Top N (20/50/100/200),点击行下钻到该用户
- 复用现有筛选(用户/时间/模型/分组等)与既有 KPI 卡片、逐条日志
- 后端对 /admin/dashboard/user-breakdown 做加法扩展(向后兼容):
- UserBreakdownItem 增加 input_tokens/output_tokens/cache_tokens
- 新增 sort_by(白名单排序,防注入,缺省仍按 actual_cost)
- 新增 sort_by 转发单元测试;更新 UsageView.spec 稳定桩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-09 06:04:22 -04:00
shaw
49fb18e073
Merge origin/main into worktree/brave-valley-9578
...
Resolve conflict in api_key_repo.go: keep both ListAllByUserID (this PR)
and attachLastUsedIPs/latestUsageLogIPs (main), and have ListAllByUserID
attach last-used IPs so the current_concurrency sort path keeps the
last_used_ip column populated.
2026-07-09 17:17:16 +08:00