
sub2api 开出修 Grok 停调阈值的补丁 #8343:把计费账单接进判定,但读数十分钟就过期,而响应头那条候选在调度快照里根本读不到值;附今晚不升级也能用的处置顺序,以及一条 Kimi 文档草稿与随包模型目录的核对。
ba81c7fd。window=quota,用量取 grok_sched_utilization,截止取 grok_sched_reset_at。
backend/internal/service/account_scheduling_threshold_eval.go 第 336–356 行:第 338–341 行的注释写「计费 7d/30d 窗口不参与停调」,第 346–353 行只有一个 window: "quota" 候选。now 参数,然后在账号是 Grok OAuth 时再追加两条。4billing.UsagePercent 与 billing.PeriodEnd,时间戳用 WeeklyUpdatedAt。UsedPercent 与 BillingPeriodEnd,时间戳用 MonthlyUpdatedAt。
backend/internal/service/account_scheduling_threshold_eval.go 第 342–388 行:第 354 行的 IsGrokOAuth() 决定要不要读账单,第 376 行的 now.Sub(*observedAt) >= openAIProbeCacheTTL 就是十分钟那道闸。period_end 解析成功并晚于现在。5pickLatestResetSchedulingCandidate 取截止更晚的那条。7billing_period_end 断言成停调终点。月窗口一旦过线,账号就停到月周期结束。getGrokUsage:账号是 Grok OAuth,且快照需要刷新,或者调用方强制。10
backend/internal/service/account_usage_service.go 第 1227–1241 行:grokBillingSnapshotNeedsRefresh 在第 1232 行先看 partial 与失败窗口,第 1240 行用同一个 openAIProbeCacheTTL 判旧。
backend/internal/repository/scheduler_cache.go 第 1336–1348 行:filterSchedulerExtra 的键表在第 1343 行以 "grok_billing_snapshot" 收尾;grok_sched_utilization 与 grok_sched_reset_at 整张表里都搜不到。GET /api/v1/admin/grok/accounts/:id/quota 会走账单探测,把周、月两份结果写进 grok_billing_snapshot。1617POST /api/v1/admin/accounts/:id/schedulable,body 传 {"schedulable": false}。18true;临时不可调度用 DELETE /api/v1/admin/accounts/:id/temp-unschedulable 单独清。19POST /api/v1/admin/accounts/usage/batch 排一个五分钟一次的定时调用,body 传 {"account_ids": [...], "force": true}。少了后一样,十分钟的闸会把候选筛掉。20window(7d 或 30d)、used_percent、threshold_percent、until_unix;日志键是 account_scheduling_threshold_temp_unschedulable。--local-model 启动或用不了外网的实例,读的仍是随包那 10 条。要在分组里配 kimi-k3.1-pro,先对本机的 GET /v1/models 确认有没有这一条。selection_id 塞进调度元数据,再抄进新的 UsageRecord.SelectionID,属增量字段。目前 0 评论,没有补丁。ba81c7fd(10-25 21:48),正好是 #8343 的基线。github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
raw.githubusercontent.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
status.openai.com
status.claude.com
status.cloud.google.com
codex-reset.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.