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

推荐订阅源

C
Check Point Blog
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
S
SegmentFault 最新的问题
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - Franky
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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 cli credential assertions · openclaw/opencl...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -66,6 +66,15 @@ function mockClaudeCliCredentialRead() {

6666

);

6767

}

686869+

function expectFields(value: unknown, expected: Record<string, unknown>): void {

70+

expect(value).toBeTypeOf("object");

71+

expect(value).not.toBeNull();

72+

const record = value as Record<string, unknown>;

73+

for (const [key, expectedValue] of Object.entries(expected)) {

74+

expect(record[key], key).toEqual(expectedValue);

75+

}

76+

}

77+6978

describe("cli credentials", () => {

7079

beforeAll(async () => {

7180

({

@@ -232,13 +241,13 @@ describe("cli credentials", () => {

232241

if (!first || !second) {

233242

throw new Error("expected cached Claude CLI credentials to be available");

234243

}

235-

expect(first).toMatchObject({

244+

expectFields(first, {

236245

type: "oauth",

237246

provider: "anthropic",

238247

access: expect.stringMatching(/^token-/),

239248

refresh: "cached-refresh",

240249

});

241-

expect(second).toMatchObject({

250+

expectFields(second, {

242251

type: "oauth",

243252

provider: "anthropic",

244253

access: expect.stringMatching(/^token-/),

@@ -277,7 +286,7 @@ describe("cli credentials", () => {

277286

execSync: execSyncMock,

278287

});

279288280-

expect(withKeychain).toMatchObject({

289+

expectFields(withKeychain, {

281290

type: "oauth",

282291

provider: "anthropic",

283292

refresh: "cached-refresh",

@@ -305,7 +314,7 @@ describe("cli credentials", () => {

305314

execSync: execSyncMock,

306315

});

307316308-

expect(withKeychain).toMatchObject({

317+

expectFields(withKeychain, {

309318

type: "oauth",

310319

provider: "anthropic",

311320

refresh: "cached-refresh",

@@ -337,7 +346,7 @@ describe("cli credentials", () => {

337346338347

const creds = readCodexCliCredentials({ platform: "darwin", execSync: execSyncMock });

339348340-

expect(creds).toMatchObject({

349+

expectFields(creds, {

341350

access: createJwtWithExp(expSeconds),

342351

refresh: "keychain-refresh",

343352

provider: "openai-codex",

@@ -370,7 +379,7 @@ describe("cli credentials", () => {

370379371380

const creds = readCodexCliCredentials({ execSync: execSyncMock });

372381373-

expect(creds).toMatchObject({

382+

expectFields(creds, {

374383

access: createJwtWithExp(expSeconds),

375384

refresh: "file-refresh",

376385

provider: "openai-codex",

@@ -403,7 +412,7 @@ describe("cli credentials", () => {

403412

execSync: execSyncMock,

404413

});

405414406-

expect(creds).toMatchObject({

415+

expectFields(creds, {

407416

access: createJwtWithExp(expSeconds),

408417

refresh: "file-refresh",

409418

provider: "openai-codex",

@@ -439,7 +448,7 @@ describe("cli credentials", () => {

439448

execSync: execSyncMock,

440449

});

441450442-

expect(withKeychain).toMatchObject({

451+

expectFields(withKeychain, {

443452

access: createJwtWithExp(expSeconds),

444453

refresh: "keychain-refresh",

445454

provider: "openai-codex",

@@ -486,12 +495,12 @@ describe("cli credentials", () => {

486495

execSync: execSyncMock,

487496

});

488497489-

expect(withKeychain).toMatchObject({

498+

expectFields(withKeychain, {

490499

refresh: "keychain-refresh",

491500

expires: keychainExpiry * 1000,

492501

provider: "openai-codex",

493502

});

494-

expect(withoutPrompt).toMatchObject({

503+

expectFields(withoutPrompt, {

495504

refresh: "file-refresh",

496505

expires: fileExpiry * 1000,

497506

provider: "openai-codex",

@@ -526,7 +535,7 @@ describe("cli credentials", () => {

526535

execSync: execSyncMock,

527536

});

528537529-

expect(first).toMatchObject({

538+

expectFields(first, {

530539

refresh: "stale-refresh",

531540

expires: firstExpiry * 1000,

532541

});

@@ -550,7 +559,7 @@ describe("cli credentials", () => {

550559

execSync: execSyncMock,

551560

});

552561553-

expect(second).toMatchObject({

562+

expectFields(second, {

554563

refresh: "fresh-refresh",

555564

expires: secondExpiry * 1000,

556565

});

@@ -581,7 +590,7 @@ describe("cli credentials", () => {

581590582591

const creds = readGeminiCliCredentialsCached({ homeDir: tempHome, ttlMs: 0 });

583592584-

expect(creds).toMatchObject({

593+

expectFields(creds, {

585594

type: "oauth",

586595

provider: "google-gemini-cli",

587596

access: "gemini-access",

@@ -611,7 +620,7 @@ describe("cli credentials", () => {

611620612621

const creds = readGeminiCliCredentialsCached({ homeDir: tempHome, ttlMs: 0 });

613622614-

expect(creds).toMatchObject({

623+

expectFields(creds, {

615624

type: "oauth",

616625

provider: "google-gemini-cli",

617626

access: "gemini-access",