codex: a reset set to go when the week runs out is spent before the credits

tongzhenbao on X: a Codex Pro account with "when its week runs out" on,
its week at 0% left, one reset held until 11-06 (after the week's own
reset on 11-03) and Use credits on. Overnight ~10k credits went and the
reset stayed; the card said "not auto-used" beside the switch on.

Cause: the week's auto-use ran only on a vendor refusal. autoReset in
routing needs a 429 usage_limit_reached on the last candidate, and the
relay's autoResetSignedIn the same on its 429. An account let spend its
credits is never refused for its week: ChatGPT answers on the credits,
and routing never benches it (full() and onCredits). So the week's reset
could only ever be spent with credits off.

Decision (product call delegated): a reset is free, credits cost money,
so a reset the user set to go when the week runs out goes before any
credits. resetBeforeCredits runs before a try is sent to a Codex account
on its credits whose last reading has its week used up, with the week's
switch on; AutoUseCodexReset reads the week again and keeps one a week
at most, so a second time in the same week goes on the credits. Hooked
in the routing loop and in codexUpstreamOn (the relay, signed-in or an
account). With no reset held, or the week's switch off, nothing changes.

The card's summary: with only the week's switch on it now says "auto-used
when the week runs out" (zh 周额度用完时自动使用), not "not auto-used",
with its title in all five languages. CLI help and auto-reset messages
say "or before its credits are spent". gateway-routing.md names it.

Siblings: the expiring switch already spends regardless of credits
(usedUp ignores them); the credits-off path (planned.held) is unchanged.

Run (mote, through mote-run, at this tree):
- go test ./internal/gateway -run 'TestCodexResetBeforeCredits|TestCodexAutoReset|TestCodexCredits|TestCodexNoCredits': ok
- broken by hand: gateway.go and codex_backend.go at origin/main:
  TestCodexResetBeforeCredits/relayed and /routed red (200, spent ""),
  the two negative cases green
- node --test codex-auto-reset, i18n-keys, codex-auto-reset-settings,
  codex-resets-used, panel-options-fold, quota-curve: 96/96 (chromium +
  webkit, en/zh/zh-TW/ja/de); codex-auto-reset red with origin/main's
  app.js ("· not auto-used")
- full suite, before the rebase onto 300b7eee0: wsl-run go test -timeout
  45m ./... ok for internal/gateway, provider, settings, tui and the rest;
  root, cli and gui don't build in WSL (no gtk4/webkitgtk-6.0), and
  internal/agent's fake-binary tests (TestInstalledVersion and four more)
  fail there with "Invalid argument"; on mote those packages are ok
  (., cli 49s, agent 179s)
- at the pushed head 7b6a0675f (on 300b7eee0), on mote: internal/gui,
  provider and cli; provider and cli ok, gui ok except TestMainWindowCorners,
  red the same on a clean 300b7eee0 copy on mote (macOS 27), #3949;
  TestCoreScriptBudget ok with no raise (app.js 1,311,588 of 1,311,735,
  after shortening resetsWords' change); the focused gateway tests and the
  six GUI files above again, ok and 96/96
Not tried: a real account with credits and a held reset at 0% week; the
owner's accounts have no reset at 0% to spend.
This commit is contained in:
yetone
2026-10-29 08:17:12 +08:00
parent 300b7eee08
commit 0e2739743b
10 changed files with 203 additions and 14 deletions
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -32,8 +32,8 @@ const quotaUsage = `usage: magpie quota [<provider>…] [--json]
starting the account's current windows again (the one Codex is signed in to unless
named). It can't be undone, so it asks first; --yes doesn't. quota auto-reset on lets
the account spend one by itself when its weekly window is used up and no other
account can take a request, one a week at most (the five hours running out never
does), and spend the one about to expire about half an hour before it does, if
account can take a request, or before a request goes on its credits, one a week
at most (the five hours running out never does), and spend the one about to expire about half an hour before it does, if
the account's windows have been used, so what they have left can be used until
then and it isn't lost; at once when the account is held up until after then.
week on|off or expiring on|off turns only one of those two times on or off, the
@@ -47,7 +47,7 @@ const quotaUsage = `usage: magpie quota [<provider>…] [--json]
goes to the other accounts, groups and fallbacks, or is refused with why (with
auto-reset on, its week used up and no one else left, it spends a reset first).
on, the default, lets the vendor answer on its credits then, so the task goes
on; alone it says which accounts don't spend theirs.
on (with auto-reset's week on, a reset held is spent before the credits); alone it says which accounts don't spend theirs.
quota alert 80 has the magpie app notify when any window of a subscription or plan
reaches 80% used, once each time the window runs (not windows set aside, such as
on-demand spending); --balance 5 when a balance falls to 5 or under, in its own
@@ -316,9 +316,9 @@ func quotaAutoResetCmd(args []string) error {
}
switch week, expiring := provider.CodexAutoResetWhen(user); {
case week && expiring:
fmt.Println(green.Render("✓"), user+":", "uses a reset by itself once its week is used up and no other account can answer, one a week at most, and the one about to expire half an hour before it does, or at once when held up past then")
fmt.Println(green.Render("✓"), user+":", "uses a reset by itself once its week is used up and no other account can answer, or before its credits are spent, one a week at most, and the one about to expire half an hour before it does, or at once when held up past then")
case week:
fmt.Println(green.Render("✓"), user+":", "uses a reset by itself once its week is used up and no other account can answer, one a week at most; one about to expire is left to run out")
fmt.Println(green.Render("✓"), user+":", "uses a reset by itself once its week is used up and no other account can answer, or before its credits are spent, one a week at most; one about to expire is left to run out")
case expiring:
fmt.Println(green.Render("✓"), user+":", "uses the reset about to expire half an hour before it does, or at once when held up past then; a week used up is waited out")
default:
+45
View File
@@ -98,3 +98,48 @@ func unhold(order, left []Weighed, c candidate) ([]Weighed, []Weighed) {
w.Unlisted, w.Capped, w.CapBack, w.NoCredits = false, 0, nil, false
return append(slices.Clip(order), w), slices.Delete(slices.Clone(left), i, i+1)
}
// resetBeforeCredits spends one of c's resets before a request goes to it
// on its credits (tongzhenbao on X): a Codex account set to spend one by
// itself when its week runs out, its week used up by its last reading,
// and let spend its credits. ChatGPT answers such an account on its
// credits, so it never refuses it as out of its allowance, and autoReset,
// which runs on that refusal, never ran: the week's reset was left
// unspent while the credits were. A reset is free and credits cost money,
// so the reset goes first; once none is held, or the week's one is spent,
// the credits go on as before. AutoUseCodexReset reads the week again
// before spending, one a week at most.
func (s *Server) resetBeforeCredits(ctx context.Context, c candidate) (provider.ResetOutcome, bool) {
a := c.p.Account
if a == nil || a.User == "" || !provider.AutoResetsWeek(a.Agent, a.User) {
return provider.ResetOutcome{}, false
}
if al, ok := c.allowance(); !ok || !spendsCredits(c.p, al) || !al.WeekUsedUp(time.Now()) {
return provider.ResetOutcome{}, false
}
out, ok := autoResetOf(ctx, a.Agent, a.User)
if ok {
s.Unrest(c.restKey())
}
return out, ok
}
// resetBeforeCreditsOn is resetBeforeCredits for a turn relayed on on, or
// on Codex's own sign-in when on is nil; who is the account.
func (s *Server) resetBeforeCreditsOn(ctx context.Context, on *provider.Provider) (who string, out provider.ResetOutcome, ok bool) {
if on != nil {
if on.Account == nil {
return "", provider.ResetOutcome{}, false
}
out, ok = s.resetBeforeCredits(ctx, candidate{p: *on, rest: on.ID})
return on.Account.User, out, ok
}
who, signed := provider.CodexSignedIn()
if !signed || !provider.AutoResetsWeek("codex", who) || !relayOnCredits(nil) || !allowances("codex")[who].WeekUsedUp(time.Now()) {
return "", provider.ResetOutcome{}, false
}
if out, ok = autoResetOf(ctx, "codex", who); ok {
s.Unrest("codex@" + strings.ToLower(who))
}
return who, out, ok
}
+10
View File
@@ -1084,6 +1084,16 @@ func (s *Server) codexUpstreamOn(w http.ResponseWriter, r *http.Request, rest st
}
var sniff *usageSniffer
var refusal []byte // what OpenAI said, of a request it turned away
if rest == "/responses" && base != codexAPIBase {
// the account goes on its credits, its week used up: a reset it
// spends by itself when the week runs out goes first
// (resetBeforeCredits)
if who, out, ok := s.resetBeforeCreditsOn(r.Context(), on); ok {
autoReset = true
s.trace.update(tr, func(t *Route) { t.Tries[len(t.Tries)-1].Reset = &AutoReset{Who: who, Text: out.Text()} })
resetNote = "openai (" + who + "): used one of its resets by itself before its credits (" + out.Text() + ")"
}
}
for {
// the try's own, which a stream that failed before its reply ends
// (holdWriter.stop)
@@ -0,0 +1,99 @@
package gateway
import (
"strings"
"testing"
"github.com/yetone/magpie/internal/provider"
)
// tongzhenbao on X: a Codex account set to spend a reset by itself when
// its week runs out (that switch alone on), its week used up, holding a
// reset that runs out after the week starts again, and let spend its
// credits. ChatGPT answers it on its credits, so nothing refuses it as out
// of its allowance, and the reset was never spent while ~10k credits were.
// The reset is spent before the turn goes on the credits, once a week;
// with the week's switch off, the turn goes on the credits as before.
func TestCodexResetBeforeCredits(t *testing.T) {
reporter := func(t *testing.T, b *resetBackend, user, acct string) {
t.Helper()
// answers all the same, on its credits; the reset held runs out
// 20 days on, past the week's own reset 3 days on
b.credits[acct] = true
if err := provider.SetCodexAutoResetCase(user, provider.ResetCaseWeek, true); err != nil {
t.Fatal(err)
}
if w, e := provider.CodexAutoResetWhen(user); !w || e {
t.Fatalf("set week only: week %v expiring %v", w, e)
}
}
t.Run("relayed", func(t *testing.T) {
codexSignedIn(t)
b := newResetBackend(t, "acct-1")
creditsUsage(t, map[string]float64{"me@example.com": 100}, "me@example.com")
reporter(t, b, "Me@example.com", "acct-1")
srv := New()
code, body := resetPost(t, srv)
if tried, spent := b.seen(); code != 200 || !strings.Contains(body, "pong") || tried != "acct-1" || spent != "acct-1" {
t.Fatalf("%d %s tried %q spent %q", code, body, tried, spent)
}
if got := resetsTraced(srv); len(got) != 1 || got[0] != "me@example.com: 2 windows started again" {
t.Fatalf("traced %v", got)
}
if calls := srv.Recent(); len(calls) == 0 || !strings.Contains(calls[0].Fallback, "before its credits") {
t.Fatalf("request log %+v", calls)
}
// used up again in the same week: the credits go on, no second reset
b.mu.Lock()
b.out["acct-1"], b.week["acct-1"], b.held["acct-1"] = true, 100, 1
b.mu.Unlock()
if code, _ := resetPost(t, srv); code != 200 {
t.Fatalf("second time in the week: %d", code)
}
if _, spent := b.seen(); spent != "acct-1" {
t.Fatalf("second time in the week spent %q", spent)
}
})
t.Run("routed", func(t *testing.T) {
codexSignedIn(t, "spare@example.com")
b := newResetBackend(t, "acct-1", "acct-2")
b.held["acct-2"] = 0
// spare used up with no credits: benched, never asked
creditsUsage(t, map[string]float64{"me@example.com": 100, "spare@example.com": 100}, "me@example.com")
reporter(t, b, "me@example.com", "acct-1")
srv := New()
code, body := resetPost(t, srv)
if tried, spent := b.seen(); code != 200 || !strings.Contains(body, "pong") || tried != "acct-1" || spent != "acct-1" {
t.Fatalf("%d %s tried %q spent %q", code, body, tried, spent)
}
if got := resetsTraced(srv); len(got) != 1 || got[0] != "me@example.com: 2 windows started again" {
t.Fatalf("traced %v", got)
}
})
t.Run("week's switch off", func(t *testing.T) {
codexSignedIn(t)
b := newResetBackend(t, "acct-1")
b.credits["acct-1"] = true
creditsUsage(t, map[string]float64{"me@example.com": 100}, "me@example.com")
if err := provider.SetCodexAutoResetCase("me@example.com", provider.ResetCaseExpiring, true); err != nil {
t.Fatal(err)
}
code, _ := resetPost(t, New())
if tried, spent := b.seen(); code != 200 || tried != "acct-1" || spent != "" {
t.Fatalf("%d tried %q spent %q", code, tried, spent)
}
})
t.Run("week not used up", func(t *testing.T) {
codexSignedIn(t)
b := newResetBackend(t)
b.week["acct-1"], b.held["acct-1"], b.credits["acct-1"] = 60, 1, true
creditsUsage(t, map[string]float64{"me@example.com": 60}, "me@example.com")
if err := provider.SetCodexAutoResetCase("me@example.com", provider.ResetCaseWeek, true); err != nil {
t.Fatal(err)
}
code, _ := resetPost(t, New())
if tried, spent := b.seen(); code != 200 || tried != "acct-1" || spent != "" {
t.Fatalf("%d tried %q spent %q", code, tried, spent)
}
})
}
+9
View File
@@ -2637,6 +2637,15 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request, from provider.Pro
cands = cands[:i+1]
}
}
if !autoReset && c.onCredits() {
// going to the account on its credits, its week used up: a
// reset it spends by itself when the week runs out goes
// first (resetBeforeCredits)
if out, ok := s.resetBeforeCredits(r.Context(), c); ok {
autoReset = true
resetFirst = &AutoReset{Who: c.p.Account.User, Text: out.Text(), Agent: c.p.Account.Agent}
}
}
last := i == len(cands)-1
// the last one's failure is held too when an earlier one failed,
// for its allowance running out to be told as that one's error
+5 -3
View File
@@ -17385,10 +17385,12 @@ function resetsWords(r, q) {
w.title = r.each?.length ? resetsEach(r) : t("The first runs out {when}", { when: at.toLocaleString(intlLang()) });
// whether the one that runs out first is kept from going to waste:
// with Auto-use on it is used shortly before it does (#624, #719)
// or, the week's alone, when the week runs out (tongzhenbao on X)
if (q && autoResetKept(q)) {
const on = autoResetWhen(q).expiring;
w.append(el("span", "resets-kept" + (on ? " on" : ""), " · " + t(on ? "auto-used before it expires" : "not auto-used")));
w.title += "\n" + t(on ? "Auto-use is on: the reset that runs out first is used about half an hour before it does, if this account's windows have been used, so what they have left can be used until then and it isn't lost; at once if the account is held up until after then."
const { expiring: x, week } = autoResetWhen(q);
w.append(el("span", "resets-kept" + (x || week ? " on" : ""), " · " + t(x ? "auto-used before it expires" : week ? "auto-used when the week runs out" : "not auto-used")));
w.title += "\n" + t(x ? "Auto-use is on: the reset that runs out first is used about half an hour before it does, if this account's windows have been used, so what they have left can be used until then and it isn't lost; at once if the account is held up until after then."
: week ? "Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then."
: "Auto-use is off: the reset that runs out first is lost unless it's used by hand before then.");
}
} else if (r.each?.length) w.title = resetsEach(r);
+8
View File
@@ -2042,6 +2042,8 @@ const I18N = {
"Auto-use: on": "自动用卡:开",
"Auto-use: off": "自动用卡:关",
"auto-used before it expires": "到期前自动使用",
"auto-used when the week runs out": "周额度用完时自动使用",
"Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then.": "自动使用已开启(周额度用完时):本账号周额度用完时自动用一张重置卡,先于积分扣费。快到期的卡若未手动使用、也没等到周额度用完,将作废。",
"Last reset used: {when} · {why}": "上次用卡:{when} · {why}",
"by itself, its week used up": "自动,周额度用完",
"by itself, before it expired": "自动,重置卡到期前",
@@ -6097,6 +6099,8 @@ const I18N = {
"Auto-use: on": "自動用卡:開",
"Auto-use: off": "自動用卡:關",
"auto-used before it expires": "到期前自動使用",
"auto-used when the week runs out": "週額度用完時自動使用",
"Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then.": "自動使用已開啟(週額度用完時):本帳號週額度用完時自動用一張重置卡,先於積分扣費。快到期的卡若未手動使用、也沒等到週額度用完,將作廢。",
"Last reset used: {when} · {why}": "上次用卡:{when} · {why}",
"by itself, its week used up": "自動,週額度用完",
"by itself, before it expired": "自動,重置卡到期前",
@@ -10129,6 +10133,8 @@ const I18N = {
"Auto-use: on": "自動使用:オン",
"Auto-use: off": "自動使用:オフ",
"auto-used before it expires": "期限切れ前に自動使用",
"auto-used when the week runs out": "週の枠を使い切ったら自動使用",
"Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then.": "自動使用はオン(週の枠を使い切ったとき):このアカウントの週の枠を使い切ると、クレジットを使う前にリセットを自動で使います。期限が近いリセットは、手動で使うか、それまでに週の枠を使い切らなければ失われます。",
"Last reset used: {when} · {why}": "前回のリセット使用:{when} · {why}",
"by itself, its week used up": "自動(週の枠を使い切ったため)",
"by itself, before it expired": "自動(期限切れの前)",
@@ -14191,6 +14197,8 @@ const I18N = {
"Auto-use: on": "Automatisch: an",
"Auto-use: off": "Automatisch: aus",
"auto-used before it expires": "wird vor Ablauf automatisch eingelöst",
"auto-used when the week runs out": "wird eingelöst, wenn die Woche aufgebraucht ist",
"Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then.": "Automatisches Einlösen ist an, wenn die Woche aufgebraucht ist: Ist die Woche dieses Kontos aufgebraucht, wird ein Reset eingelöst, bevor Credits verbraucht werden. Ein bald ablaufender verfällt sonst, sofern er nicht von Hand eingelöst wird oder die Woche vorher aufgebraucht ist.",
"Last reset used: {when} · {why}": "Zuletzt Reset eingelöst: {when} · {why}",
"by itself, its week used up": "automatisch, Woche aufgebraucht",
"by itself, before it expired": "automatisch, vor dem Ablauf",
+9 -5
View File
@@ -80,7 +80,7 @@ function serve(lang, posts) {
const words = {
en: {
say: "Auto-use resets:", week: "when its week runs out", expiry: "before one expires",
keptOn: "· auto-used before it expires", keptOff: "· not auto-used",
keptOn: "· auto-used before it expires", keptOff: "· not auto-used", keptWeek: "· auto-used when the week runs out",
brief: "Auto-use", label: "Auto-use resets", on: "On", off: "Off",
both: (who) => `${who} uses a reset by itself when its week runs out, or before one expires`,
weekOnly: (who) => `${who} uses a reset by itself only when its week runs out`,
@@ -90,7 +90,7 @@ const words = {
},
zh: {
say: "自动使用重置卡:", week: "周额度用完时", expiry: "重置卡到期前",
keptOn: "· 到期前自动使用", keptOff: "· 不会自动使用",
keptOn: "· 到期前自动使用", keptOff: "· 不会自动使用", keptWeek: "· 周额度用完时自动使用",
brief: "自动用卡", label: "自动使用重置卡", on: "开启", off: "关闭",
both: (who) => `${who} 会在周额度用完时、或重置卡到期前自动使用重置卡`,
weekOnly: (who) => `${who} 仅在周额度用完时自动使用重置卡`,
@@ -101,7 +101,7 @@ const words = {
};
const keys = {
say: "Auto-use resets:", week: "when its week runs out", expiry: "before one expires",
keptOn: "auto-used before it expires", keptOff: "not auto-used", brief: "Auto-use", label: "Auto-use resets", on: "On", off: "Off",
keptOn: "auto-used before it expires", keptOff: "not auto-used", keptWeek: "auto-used when the week runs out", brief: "Auto-use", label: "Auto-use resets", on: "On", off: "Off",
both: "{who} uses a reset by itself when its week runs out, or before one expires",
weekOnly: "{who} uses a reset by itself only when its week runs out",
expiryOnly: "{who} uses a reset by itself only before one expires",
@@ -116,6 +116,7 @@ const strings = [
"Off: a reset that runs out unused is lost. Click to turn it on.",
"Auto-use is on: the reset that runs out first is used about half an hour before it does, if this account's windows have been used, so what they have left can be used until then and it isn't lost; at once if the account is held up until after then.",
"Auto-use is off: the reset that runs out first is lost unless it's used by hand before then.",
"Auto-use is on for a used-up week: a reset is used by itself when this account's week is used up, before its credits are spent. One about to run out is otherwise lost unless it's used by hand or the week runs out before then.",
"On: a reset is used by itself when this account's week is used up and no other account can answer, one a week at most, and the one about to run out is used about half an hour before it does, if the account has been used, or at once when the account is held up until after then. Otherwise the five hours running out never uses one. Click to turn it off.",
"Off: this account's resets are used only by hand. Turned on, one is used by itself when its week is used up and no other account can answer, one a week at most, and the one about to run out about half an hour before it does, if the account has been used, or at once when the account is held up until after then. Otherwise the five hours running out never uses one.",
];
@@ -124,7 +125,7 @@ async function wordsOf(page, lang) {
if (words[lang]) return words[lang];
const d = await page.evaluate(([lang, keys]) => Object.fromEntries(Object.entries(keys).map(([k, v]) => [k, I18N[lang][v]])), [lang, keys]);
const fill = (s) => (who) => s.replace("{who}", who);
return { ...d, keptOn: "· " + d.keptOn, keptOff: "· " + d.keptOff, both: fill(d.both), weekOnly: fill(d.weekOnly), expiryOnly: fill(d.expiryOnly), none: fill(d.none) };
return { ...d, keptOn: "· " + d.keptOn, keptOff: "· " + d.keptOff, keptWeek: "· " + d.keptWeek, both: fill(d.both), weekOnly: fill(d.weekOnly), expiryOnly: fill(d.expiryOnly), none: fill(d.none) };
}
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
@@ -266,7 +267,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal((await panel.locator(".pq-resets button").textContent()).trim(), w.useOne);
assert.equal((await panel.locator(".pq-resets .resets-kept").textContent()).trim(), w.keptOff);
await flip(panel, week(psel), panelPosts, { user: "Me@example.com", on: true, when: "week" }, true, w.weekOnly("Me@example.com"));
assert.equal((await panel.locator(".pq-resets .resets-kept").textContent()).trim(), w.keptOff, "the week alone doesn't keep the one about to expire");
// the week alone (tongzhenbao on X): the card says it is used when
// the week runs out, not "not auto-used" beside that switch on
assert.equal((await panel.locator(".pq-resets .resets-kept").textContent()).trim(), w.keptWeek, "the week alone says the reset is used when the week runs out");
assert.equal(await panel.locator(".pq-resets .resets-kept").evaluate((e) => e.classList.contains("on")), true);
await flip(panel, expiry(psel), panelPosts, { user: "Me@example.com", on: true, when: "expiring" }, true, w.both("Me@example.com"));
assert.equal((await panel.locator(".pq-resets .resets-kept").textContent()).trim(), w.keptOn);
// the switches and their words fit the card: none of it cut off or wider
+12
View File
@@ -235,6 +235,18 @@ func (a Allowance) OnCredits() bool {
return false
}
// WeekUsedUp says whether the allowance's week, a window of a day or more
// that counts every model, is used up at now, as its last reading says:
// weekUsedUp's rule (AutoUseCodexReset) on an allowance, credits or none.
func (a Allowance) WeekUsedUp(now time.Time) bool {
for _, l := range a {
if l.Span >= 24*time.Hour && l.Model == "" && l.matches == nil && l.Used >= 100 && l.Resets.After(now) {
return true
}
}
return false
}
// Restarts is when an auto-used reset starts the account's windows again,
// as the Codex reset about to run out is spent (expiringResetSpent):
// resetExpiryLead before it runs out, or now when the account is held up