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

推荐订阅源

B
Blog RSS Feed
Martin Fowler
Martin Fowler
爱范儿
爱范儿
IT之家
IT之家
Last Week in AI
Last Week in AI
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
The Cloudflare Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog

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
test: dedupe openai codex mock reads · openclaw/openclaw@...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -17,6 +17,14 @@ function createJsonResponse(body: unknown, init?: { status?: number }) {

1717

});

1818

}

191920+

function fetchCall(fetchMock: ReturnType<typeof vi.fn<typeof fetch>>, index: number) {

21+

const call = fetchMock.mock.calls[index];

22+

if (!call) {

23+

throw new Error(`expected fetch call ${index}`);

24+

}

25+

return call;

26+

}

27+2028

describe("loginOpenAICodexDeviceCode", () => {

2129

it("requests a device code, polls for authorization, and exchanges OAuth tokens", async () => {

2230

vi.useFakeTimers();

@@ -74,30 +82,30 @@ describe("loginOpenAICodexDeviceCode", () => {

7482

await vi.advanceTimersByTimeAsync(1);

7583

const credentials = await credentialsPromise;

768477-

const userCodeRequest = fetchMock.mock.calls.at(0);

78-

expect(userCodeRequest?.[0]).toBe("https://auth.openai.com/api/accounts/deviceauth/usercode");

79-

expect(userCodeRequest?.[1]?.method).toBe("POST");

80-

expect(userCodeRequest?.[1]?.headers).toEqual({

85+

const userCodeRequest = fetchCall(fetchMock, 0);

86+

expect(userCodeRequest[0]).toBe("https://auth.openai.com/api/accounts/deviceauth/usercode");

87+

expect(userCodeRequest[1]?.method).toBe("POST");

88+

expect(userCodeRequest[1]?.headers).toEqual({

8189

"Content-Type": "application/json",

8290

originator: "openclaw",

8391

version: "2026.3.22",

8492

"User-Agent": "openclaw/2026.3.22",

8593

});

869487-

const deviceTokenRequest = fetchMock.mock.calls.at(1);

88-

expect(deviceTokenRequest?.[0]).toBe("https://auth.openai.com/api/accounts/deviceauth/token");

89-

expect(deviceTokenRequest?.[1]?.method).toBe("POST");

90-

expect(deviceTokenRequest?.[1]?.headers).toEqual({

95+

const deviceTokenRequest = fetchCall(fetchMock, 1);

96+

expect(deviceTokenRequest[0]).toBe("https://auth.openai.com/api/accounts/deviceauth/token");

97+

expect(deviceTokenRequest[1]?.method).toBe("POST");

98+

expect(deviceTokenRequest[1]?.headers).toEqual({

9199

"Content-Type": "application/json",

92100

originator: "openclaw",

93101

version: "2026.3.22",

94102

"User-Agent": "openclaw/2026.3.22",

95103

});

9610497-

const oauthTokenRequest = fetchMock.mock.calls.at(3);

98-

expect(oauthTokenRequest?.[0]).toBe("https://auth.openai.com/oauth/token");

99-

expect(oauthTokenRequest?.[1]?.method).toBe("POST");

100-

expect(oauthTokenRequest?.[1]?.headers).toEqual({

105+

const oauthTokenRequest = fetchCall(fetchMock, 3);

106+

expect(oauthTokenRequest[0]).toBe("https://auth.openai.com/oauth/token");

107+

expect(oauthTokenRequest[1]?.method).toBe("POST");

108+

expect(oauthTokenRequest[1]?.headers).toEqual({

101109

"Content-Type": "application/x-www-form-urlencoded",

102110

originator: "openclaw",

103111

version: "2026.3.22",