惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
A
About on SuperTechFans
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
美团技术团队

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix codex usage-limit recovery copy (#86305) · openclaw/o...
amknight · 2026-05-25 · via Recent Commits to openclaw:main

@@ -7,6 +7,30 @@ import {

77

} from "./rate-limits.js";

8899

describe("formatCodexUsageLimitErrorMessage", () => {

10+

it("gives actionable guidance when Codex omits reset details", () => {

11+

const message = formatCodexUsageLimitErrorMessage({

12+

message: "You've reached your usage limit.",

13+

codexErrorInfo: "usageLimitExceeded",

14+

rateLimits: {

15+

rateLimits: {

16+

limitId: "codex",

17+

primary: { usedPercent: 100, windowDurationMins: 10_080, resetsAt: null },

18+

secondary: null,

19+

},

20+

},

21+

nowMs: Date.UTC(2026, 4, 10, 23, 0, 0),

22+

});

23+24+

expect(message).toContain("You've reached your Codex subscription usage limit.");

25+

expect(message).toContain("Your weekly Codex usage limit is reached.");

26+

expect(message).toContain("OpenClaw could not determine a reset time from Codex.");

27+

expect(message).toContain("Wait until Codex becomes available");

28+

expect(message).toContain("use another Codex account if available");

29+

expect(message).toContain("switch to another configured model/provider");

30+

expect(message).not.toContain("Codex did not return a reset time");

31+

expect(message).not.toContain("/codex account");

32+

});

33+1034

it("preserves Codex retry hints when structured reset windows are absent", () => {

1135

const message = formatCodexUsageLimitErrorMessage({

1236

message:

@@ -24,6 +48,7 @@ describe("formatCodexUsageLimitErrorMessage", () => {

24482549

expect(message).toContain("You've reached your Codex subscription usage limit.");

2650

expect(message).toContain("Codex says to try again at May 11th, 2026 9:00 AM.");

51+

expect(message).toContain("Wait until the retry time");

2752

expect(message).not.toContain("Codex did not return a reset time");

2853

});

2954

@@ -42,10 +67,67 @@ describe("formatCodexUsageLimitErrorMessage", () => {

4267

});

43684469

expect(message).toContain("Next reset in 1 hour, ");

70+

expect(message).toContain("Wait until the reset time");

4571

expect(message).toMatch(/\b[A-Z][a-z]{2} \d{1,2}(?:, \d{4})? at \d{1,2}:\d{2} [AP]M\b/u);

4672

expect(message).not.toMatch(/\(\d{4}-\d{2}-\d{2}T/u);

4773

expect(message).not.toContain("Codex did not return a reset time");

4874

});

75+76+

it("uses the blocking reset when multiple Codex windows are exhausted", () => {

77+

const nowMs = 1_700_000_000_000;

78+

const nowSeconds = nowMs / 1000;

79+

const message = formatCodexUsageLimitErrorMessage({

80+

message: "You've reached your usage limit.",

81+

codexErrorInfo: "usageLimitExceeded",

82+

rateLimits: {

83+

rateLimits: {

84+

limitId: "codex",

85+

primary: { usedPercent: 100, windowDurationMins: 300, resetsAt: nowSeconds + 3600 },

86+

secondary: {

87+

usedPercent: 100,

88+

windowDurationMins: 10_080,

89+

resetsAt: nowSeconds + 24 * 3600,

90+

},

91+

},

92+

},

93+

nowMs,

94+

});

95+96+

expect(message).toContain("Next reset in 1 day");

97+

expect(message).not.toContain("Next reset in 1 hour");

98+

expect(message).toContain("Wait until the reset time");

99+

});

100+101+

it("does not use sibling bucket resets when the blocked Codex bucket omits a reset", () => {

102+

const nowMs = 1_700_000_000_000;

103+

const nowSeconds = nowMs / 1000;

104+

const message = formatCodexUsageLimitErrorMessage({

105+

message: "You've reached your usage limit.",

106+

codexErrorInfo: "usageLimitExceeded",

107+

rateLimits: {

108+

rateLimitsByLimitId: {

109+

codex: {

110+

limitId: "codex",

111+

limitName: "Codex",

112+

primary: { usedPercent: 100, windowDurationMins: 300, resetsAt: null },

113+

secondary: null,

114+

},

115+

"gpt-5.3-codex-spark": {

116+

limitId: "gpt-5.3-codex-spark",

117+

limitName: "GPT 5.3 Codex Spark",

118+

primary: { usedPercent: 0, windowDurationMins: 300, resetsAt: nowSeconds + 3600 },

119+

secondary: null,

120+

},

121+

},

122+

},

123+

nowMs,

124+

});

125+126+

expect(message).toContain("OpenClaw could not determine a reset time from Codex.");

127+

expect(message).toContain("Wait until Codex becomes available");

128+

expect(message).not.toContain("Next reset");

129+

expect(message).not.toContain("1 hour");

130+

});

49131

});

5013251133

describe("Codex rate limit blocking resets", () => {