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

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Vercel News
Vercel News
Last Week in AI
Last Week in AI
H
Help Net Security
The Cloudflare Blog
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
I
InfoQ
U
Unit 42
美团技术团队
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
宝玉的分享
宝玉的分享
量子位
博客园_首页

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: tighten openai device code assertions · openclaw/op...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -23,7 +23,7 @@ describe("loginOpenAICodexDeviceCode", () => {

2323

vi.stubEnv("OPENCLAW_VERSION", "2026.3.22");

2424

try {

2525

const fetchMock = vi

26-

.fn()

26+

.fn<typeof fetch>()

2727

.mockResolvedValueOnce(

2828

createJsonResponse({

2929

device_auth_id: "device-auth-123",

@@ -74,45 +74,35 @@ describe("loginOpenAICodexDeviceCode", () => {

7474

await vi.advanceTimersByTimeAsync(1);

7575

const credentials = await credentialsPromise;

767677-

expect(fetchMock).toHaveBeenNthCalledWith(

78-

1,

79-

"https://auth.openai.com/api/accounts/deviceauth/usercode",

80-

expect.objectContaining({

81-

method: "POST",

82-

headers: {

83-

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

84-

originator: "openclaw",

85-

version: "2026.3.22",

86-

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

87-

},

88-

}),

89-

);

90-

expect(fetchMock).toHaveBeenNthCalledWith(

91-

2,

92-

"https://auth.openai.com/api/accounts/deviceauth/token",

93-

expect.objectContaining({

94-

method: "POST",

95-

headers: {

96-

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

97-

originator: "openclaw",

98-

version: "2026.3.22",

99-

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

100-

},

101-

}),

102-

);

103-

expect(fetchMock).toHaveBeenNthCalledWith(

104-

4,

105-

"https://auth.openai.com/oauth/token",

106-

expect.objectContaining({

107-

method: "POST",

108-

headers: {

109-

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

110-

originator: "openclaw",

111-

version: "2026.3.22",

112-

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

113-

},

114-

}),

115-

);

77+

const userCodeRequest = fetchMock.mock.calls[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({

81+

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

82+

originator: "openclaw",

83+

version: "2026.3.22",

84+

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

85+

});

86+87+

const deviceTokenRequest = fetchMock.mock.calls[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({

91+

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

92+

originator: "openclaw",

93+

version: "2026.3.22",

94+

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

95+

});

96+97+

const oauthTokenRequest = fetchMock.mock.calls[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({

101+

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

102+

originator: "openclaw",

103+

version: "2026.3.22",

104+

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

105+

});

116106

expect(onVerification).toHaveBeenCalledWith({

117107

verificationUrl: "https://auth.openai.com/codex/device",

118108

userCode: "CODE-12345",

@@ -121,10 +111,9 @@ describe("loginOpenAICodexDeviceCode", () => {

121111

expect(onProgress).toHaveBeenNthCalledWith(1, "Requesting device code…");

122112

expect(onProgress).toHaveBeenNthCalledWith(2, "Waiting for device authorization…");

123113

expect(onProgress).toHaveBeenNthCalledWith(3, "Exchanging device code…");

124-

expect(credentials).toMatchObject({

125-

access: expect.any(String),

126-

refresh: "refresh-token-123",

127-

});

114+

expect(typeof credentials.access).toBe("string");

115+

expect(credentials.access.length).toBeGreaterThan(0);

116+

expect(credentials.refresh).toBe("refresh-token-123");

128117

expect(credentials).not.toHaveProperty("accountId");

129118

expect(credentials.expires).toBeGreaterThan(Date.now());

130119

} finally {