Repository navigation
Conversation
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 7ca069b3-bb95-426a-b8da-496d4be28b45) |
Store vm_test_renew_claim per VM so stop/reload cannot resend the same 5h/7d episode. Skips no longer consume claims; auto-renew treats probe failures as probe_unavailable. Codex preheat probes honor isCodexSlotParked and quota window reasons before firing. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Pass routingConfig soft limits via preheatWindowStateForVm on the server. Gate-blocked auto-renew sweeps only throttle in-memory/debug logs, not last_run fields in SettingsRepo. Co-authored-by: ted <kuhlmangarry24@gmail.com>
cursor
Bot
force-pushed
the
cursor/1874-renew-claim-persist-01a2
branch
from
November 27, 2026 07:28
530946e to
b125ff1
Compare
Read routingConfig.codex.quota at windowState call time; record auto-renew gate skips only when the skip reason changes. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Drop vm.policy.quota from preheat policy; server calls preheatWindowStateLikeServer. Clear renew gate-skip memory on success. Co-authored-by: ted <kuhlmangarry24@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与结果
此前
auto_renew扫窗用进程内renewFiredAt,stop/reload会清掉状态,同一窗口可能重复续热;且在 gate 跳过前就登记,导致本可重试的窗口被“吃掉”。探测抛错时 cron 仍可放行,但续热路径不应发真实请求。Codex 预热 gate 未对齐调度器的额度判定。改后:按
vmId + accountId + 旧 5h/7d reset(秒级)生成 episode key,领取写入独立vm_test_renew_claim:<vmId>;仅 gate 通过后才领取并发送;auto_renew探测不可用记probe_unavailable且不发请求。生产windowState经preheatWindowStateLikeServer(vm, () => routingConfig, …)现读全局routingConfig.codex.quota(Codex 不认vm.policy.quota,与evaluateCodexQuotaSchedule一致的全局阈值)。续热 gate 跳过:同一last_skipped原因不重复写 SettingsRepo;原因变化时记一次;续热成功后清除内存去重表,同一原因再次拦下可再记。Refs #1874
目标版本: ≥ 1.4.237(CHANGELOG / VERSION 本 PR 不改;发版说明只写此处)
Release notes(不落 CHANGELOG):
codex.quota的limit_5h/limit_7d;阈值由运营配置。本 PR 不阻断(待后续 / ted 口径):
_run早退,仍会消耗该 episode 领取且跨重启不重试。auto_renew同样走持久领取与probe_unavailable(口径 4 待 ted 确认)。实现
preheatOpenAIQuotaPolicy(全局 only)、preheatWindowStateLikeServer(server + 单测共用):vm-test-preheat-window.mjsVM_TEST_RENEW_CLAIM_PREFIX、_maybeRecordRenewGateSkip、成功后续热清除 skip 内存:vm-test-schedule.mjsserver.mjs:preheatWindowStateLikeServer/renewEpisodeKey/onRenewGateSkip验证
Note
Medium Risk
Changes scheduled preheat/auto-renew behavior and persisted settings; mis-gating could skip or duplicate renew traffic, but does not touch auth or inference routing.
Reviewed by Cursor Bugbot for commit eb9d46e. Configure here.