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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
博客园_首页
美团技术团队
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
J
Java Code Geeks
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
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
Redact persisted secret-shaped payloads [AI] (#79006) · o...
pgondhi987 · 2026-05-11 · via Recent Commits to openclaw:main

@@ -28,6 +28,20 @@ const {

2828

formatProviderAuthProfileApiKeyWithPluginMock,

2929

} = getOAuthProviderRuntimeMocks();

303031+

function expectPersistedOpenAICodexProfileWithoutInlineTokens(

32+

credential: AuthProfileStore["profiles"][string],

33+

metadata: Record<string, unknown> = {},

34+

): void {

35+

expect(credential).toMatchObject({

36+

type: "oauth",

37+

provider: "openai-codex",

38+

...metadata,

39+

});

40+

expect(credential).not.toHaveProperty("access");

41+

expect(credential).not.toHaveProperty("refresh");

42+

expect(credential).not.toHaveProperty("idToken");

43+

}

44+3145

function requireOAuthCredential(store: AuthProfileStore, profileId: string): OAuthCredential {

3246

const profile = store.profiles[profileId];

3347

if (!profile || profile.type !== "oauth") {

@@ -36,7 +50,7 @@ function requireOAuthCredential(store: AuthProfileStore, profileId: string): OAu

3650

return profile;

3751

}

385239-

vi.mock("@earendil-works/pi-ai/oauth", () => ({

53+

vi.mock("@mariozechner/pi-ai/oauth", () => ({

4054

getOAuthProviders: () => [{ id: "anthropic" }, { id: "openai-codex" }],

4155

getOAuthApiKey: vi.fn(async (provider: string, credentials: Record<string, OAuthCredential>) => {

4256

const credential = credentials[provider];

@@ -85,7 +99,7 @@ describe("resolveApiKeyForProfile OAuth refresh mirror-to-main (#26322)", () =>

8599

await removeOAuthTestTempRoot(tempRoot);

86100

});

8710188-

it("mirrors refreshed credentials into the main store so peers skip refresh", async () => {

102+

it("mirrors refreshed Codex OAuth metadata into the main store without inline tokens", async () => {

89103

const profileId = "openai-codex:default";

90104

const provider = "openai-codex";

91105

const accountId = "acct-shared";

@@ -116,15 +130,17 @@ describe("resolveApiKeyForProfile OAuth refresh mirror-to-main (#26322)", () =>

116130117131

expect(result?.apiKey).toBe("sub-refreshed-access");

118132119-

// Main store should now carry the refreshed credential, so a peer agent

120-

// starting fresh will adopt rather than race.

133+

// Main store should now carry refreshed metadata, so a peer agent

134+

// starting fresh can resolve the runtime credential without token races.

121135

const mainRaw = JSON.parse(

122136

await fs.readFile(path.join(mainAgentDir, "auth-profiles.json"), "utf8"),

123137

) as AuthProfileStore;

124-

const mainCredential = requireOAuthCredential(mainRaw, profileId);

125-

expect(mainCredential.access).toBe("sub-refreshed-access");

126-

expect(mainCredential.refresh).toBe("sub-refreshed-refresh");

127-

expect(mainCredential.expires).toBe(freshExpiry);

138+

expectPersistedOpenAICodexProfileWithoutInlineTokens(mainRaw.profiles[profileId], {

139+

expires: freshExpiry,

140+

accountId,

141+

});

142+

expect(JSON.stringify(mainRaw)).not.toContain("sub-refreshed-access");

143+

expect(JSON.stringify(mainRaw)).not.toContain("sub-refreshed-refresh");

128144

});

129145130146

it("does not mirror when refresh was performed from the main agent itself", async () => {

@@ -161,10 +177,11 @@ describe("resolveApiKeyForProfile OAuth refresh mirror-to-main (#26322)", () =>

161177

const mainRaw = JSON.parse(

162178

await fs.readFile(path.join(mainAgentDir, "auth-profiles.json"), "utf8"),

163179

) as AuthProfileStore;

164-

const mainCredential = requireOAuthCredential(mainRaw, profileId);

165-

expect(mainCredential.access).toBe("main-refreshed-access");

166-

expect(mainCredential.refresh).toBe("main-refreshed-refresh");

167-

expect(mainCredential.expires).toBe(freshExpiry);

180+

expectPersistedOpenAICodexProfileWithoutInlineTokens(mainRaw.profiles[profileId], {

181+

expires: freshExpiry,

182+

});

183+

expect(JSON.stringify(mainRaw)).not.toContain("main-refreshed-access");

184+

expect(JSON.stringify(mainRaw)).not.toContain("main-refreshed-refresh");

168185

expect(refreshProviderOAuthCredentialWithPluginMock).toHaveBeenCalledTimes(1);

169186

});

170187

@@ -332,17 +349,22 @@ describe("resolveApiKeyForProfile OAuth refresh mirror-to-main (#26322)", () =>

332349

const subRaw = JSON.parse(

333350

await fs.readFile(path.join(subAgentDir, "auth-profiles.json"), "utf8"),

334351

) as AuthProfileStore;

335-

const subCredential = requireOAuthCredential(subRaw, profileId);

336-

expect(subCredential.access).toBe("local-stale-access");

337-

expect(subCredential.refresh).toBe("local-stale-refresh");

352+

expectPersistedOpenAICodexProfileWithoutInlineTokens(subRaw.profiles[profileId], {

353+

expires: now - 120_000,

354+

accountId,

355+

});

356+

expect(JSON.stringify(subRaw)).not.toContain("local-stale-access");

357+

expect(JSON.stringify(subRaw)).not.toContain("local-stale-refresh");

338358339359

const mainRaw = JSON.parse(

340360

await fs.readFile(path.join(mainAgentDir, "auth-profiles.json"), "utf8"),

341361

) as AuthProfileStore;

342-

const mainCredential = requireOAuthCredential(mainRaw, profileId);

343-

expect(mainCredential.access).toBe("main-owner-refreshed-access");

344-

expect(mainCredential.refresh).toBe("main-owner-refreshed-refresh");

345-

expect(mainCredential.expires).toBe(freshExpiry);

362+

expectPersistedOpenAICodexProfileWithoutInlineTokens(mainRaw.profiles[profileId], {

363+

expires: freshExpiry,

364+

accountId,

365+

});

366+

expect(JSON.stringify(mainRaw)).not.toContain("main-owner-refreshed-access");

367+

expect(JSON.stringify(mainRaw)).not.toContain("main-owner-refreshed-refresh");

346368

});

347369348370

it("inherits main-agent credentials via the catch-block fallback when refresh throws after main becomes fresh", async () => {

@@ -410,7 +432,10 @@ describe("resolveApiKeyForProfile OAuth refresh mirror-to-main (#26322)", () =>

410432

const subRaw = JSON.parse(

411433

await fs.readFile(path.join(subAgentDir, "auth-profiles.json"), "utf8"),

412434

) as AuthProfileStore;

413-

expect(requireOAuthCredential(subRaw, profileId).access).toBe("cached-access-token");

435+

expectPersistedOpenAICodexProfileWithoutInlineTokens(subRaw.profiles[profileId], {

436+

accountId: "acct-shared",

437+

});

438+

expect(JSON.stringify(subRaw)).not.toContain("cached-access-token");

414439

});

415440416441

it("mirrors refreshed credentials produced by the plugin-refresh path", async () => {