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

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

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: parse provider retry dates strictly · openclaw/openc...
steipete · 2026-05-29 · via Recent Commits to openclaw:main

@@ -1075,6 +1075,67 @@ describe("buildGuardedModelFetch", () => {

10751075

expect(response.headers.get("x-should-retry")).toBe("false");

10761076

});

107710771078+

function formatObsoleteHttpDates(date: Date): Array<[string, string]> {

1079+

const dayNames = [

1080+

["Sun", "Sunday"],

1081+

["Mon", "Monday"],

1082+

["Tue", "Tuesday"],

1083+

["Wed", "Wednesday"],

1084+

["Thu", "Thursday"],

1085+

["Fri", "Friday"],

1086+

["Sat", "Saturday"],

1087+

] as const;

1088+

const monthNames = [

1089+

"Jan",

1090+

"Feb",

1091+

"Mar",

1092+

"Apr",

1093+

"May",

1094+

"Jun",

1095+

"Jul",

1096+

"Aug",

1097+

"Sep",

1098+

"Oct",

1099+

"Nov",

1100+

"Dec",

1101+

] as const;

1102+

const [shortDay, longDay] = dayNames[date.getUTCDay()] ?? dayNames[0];

1103+

const month = monthNames[date.getUTCMonth()] ?? monthNames[0];

1104+

const day = String(date.getUTCDate()).padStart(2, "0");

1105+

const shortYear = String(date.getUTCFullYear() % 100).padStart(2, "0");

1106+

const hours = String(date.getUTCHours()).padStart(2, "0");

1107+

const minutes = String(date.getUTCMinutes()).padStart(2, "0");

1108+

const seconds = String(date.getUTCSeconds()).padStart(2, "0");

1109+

const time = `${hours}:${minutes}:${seconds}`;

1110+

return [

1111+

["RFC 850", `${longDay}, ${day}-${month}-${shortYear} ${time} GMT`],

1112+

[

1113+

"asctime",

1114+

`${shortDay} ${month} ${day.padStart(2, " ")} ${time} ${date.getUTCFullYear()}`,

1115+

],

1116+

];

1117+

}

1118+1119+

it.each([...formatObsoleteHttpDates(new Date(Date.now() + 120_000))])(

1120+

"parses obsolete HTTP-date retry-after values: %s",

1121+

async (_label, retryAfter) => {

1122+

fetchWithSsrFGuardMock.mockResolvedValue({

1123+

response: new Response(null, {

1124+

status: 503,

1125+

headers: { "retry-after": retryAfter },

1126+

}),

1127+

finalUrl: "https://api.anthropic.com/v1/messages",

1128+

release: vi.fn(async () => undefined),

1129+

});

1130+

const response = await buildGuardedModelFetch(anthropicModel)(

1131+

"https://api.anthropic.com/v1/messages",

1132+

{ method: "POST" },

1133+

);

1134+1135+

expect(response.headers.get("x-should-retry")).toBe("false");

1136+

},

1137+

);

1138+10781139

it("respects OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS", async () => {

10791140

process.env.OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS = "10";

10801141

fetchWithSsrFGuardMock.mockResolvedValue({

@@ -1203,22 +1264,25 @@ describe("buildGuardedModelFetch", () => {

12031264

expect(response.headers.get("x-should-retry")).toBeNull();

12041265

});

120512661206-

it("treats malformed 429 retry-after values as terminal", async () => {

1207-

fetchWithSsrFGuardMock.mockResolvedValue({

1208-

response: new Response(null, {

1209-

status: 429,

1210-

headers: { "retry-after": "soon" },

1211-

}),

1212-

finalUrl: "https://api.anthropic.com/v1/messages",

1213-

release: vi.fn(async () => undefined),

1214-

});

1215-

const response = await buildGuardedModelFetch(anthropicModel)(

1216-

"https://api.anthropic.com/v1/messages",

1217-

{ method: "POST" },

1218-

);

1267+

it.each(["soon", "1.5", "0x10"])(

1268+

"treats malformed 429 retry-after values as terminal: %s",

1269+

async (retryAfter) => {

1270+

fetchWithSsrFGuardMock.mockResolvedValue({

1271+

response: new Response(null, {

1272+

status: 429,

1273+

headers: { "retry-after": retryAfter },

1274+

}),

1275+

finalUrl: "https://api.anthropic.com/v1/messages",

1276+

release: vi.fn(async () => undefined),

1277+

});

1278+

const response = await buildGuardedModelFetch(anthropicModel)(

1279+

"https://api.anthropic.com/v1/messages",

1280+

{ method: "POST" },

1281+

);

121912821220-

expect(response.headers.get("x-should-retry")).toBe("false");

1221-

});

1283+

expect(response.headers.get("x-should-retry")).toBe("false");

1284+

},

1285+

);

1222128612231287

it("ignores retry-after on non-retryable responses", async () => {

12241288

fetchWithSsrFGuardMock.mockResolvedValue({