Repository navigation
feat(openai): warm up general quota buckets after reset - #725
Conversation
Co-authored-by: Codex <noreply@openai.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0628a0fb19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.synchronize_passive_rate_limits_with_usage(account, rate_limits, true) | ||
| .await |
There was a problem hiding this comment.
当上游返回额度头或 codex.rate_limits,随后以 response.failed 或流内错误拒绝请求时,这里仍无条件传入 true。provider/execution.rs 的 terminal_failure 和流读取失败分支都会经 synchronize_passive_quota 调用此方法,因此即使请求没有消耗额度,也会写入 _cpr_bucket_last_used_at。WarmupProgress::reconcile 随后将该时间视为重置后的使用证据,跳过整个窗口的预热;后续主动刷新也会保留这一错误证据。应让这些调用方显式传递是否存在实际使用证据,失败路径只合并额度事实,不默认标记已使用。
Useful? React with 👍 / 👎.
Co-authored-by: Codex <noreply@openai.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2c813803b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <ZFormItem v-if="row.warmup" :label="t('accounts.quotaSettings.model')" required> | ||
| <ZSelect v-model="row.model" class="w-full" :options="modelOptions" :aria-label="`${row.label} · ${t('accounts.quotaSettings.model')}`" :placeholder="t('accounts.quotaSettings.modelPlaceholder')" :empty-text="t('accounts.connectionTest.noModels')" :disabled="loading || loadingModels" /> |
There was a problem hiding this comment.
这是界面验证缺口,而非已确认的布局缺陷:本次弹窗新增了逐桶预热开关和条件显示的模型选择器,但目标提交说明仍标注“前后对照截图待补”。请补充对应此提交、可供审查者访问的变更前后运行截图,展示弹窗展开及开启预热后的状态,并记录保存和重新打开的交互验证结果;仅有布局确认和构建通过不足以核对这些新增状态。仓库 AGENTS.md 明确要求缺少必需截图时补齐。
AGENTS.md reference: AGENTS.md:L71-L71
Useful? React with 👍 / 👎.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
问题与改动
Closes #714
现有 Cron 按固定时间启动预热,而各账号的通用额度窗口有各自的重置时间。额度桶设置现在可为每个通用窗口配置调度上限和预热模型。开启预热后,窗口重置满 5 分钟才复查额度。有本轮使用证据就跳过,取整为 0% 的请求和成功的 Cron 预热也参与判断。
窗口判断使用 Codex 的
RateLimitWindowSnapshot。上游提供重置时间和用量比例,空闲时的滚动重置时间会保留首次登记的到期边界,本地请求反馈补足用量取整带来的信息缺口。迁移
0044将已有调度上限转入quotaSettings,预热默认关闭。管理 API 使用quotaSettings替代quotaLimits,调用方须同步更新字段和结构。自审与验证
psql后复跑通过。在 PostgreSQL 18 用旧上限和空配置验证了0044,原上限保留,预热默认关闭。页面截图
账号详情 → 额度桶设置。前后对照截图待补。
AI 使用
Codex(
gpt-6.1-sol)参与实现、自审和回归验证;gpt-6-astra参与审查修复和回归验证。