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

推荐订阅源

B
Blog RSS Feed
博客园_首页
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
The Hacker News
The Hacker News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
S
SegmentFault 最新的问题
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
P
Privacy & Cybersecurity Law Blog
AI
AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Schneier on Security
Schneier on Security
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
量子位
Forbes - Security
Forbes - Security
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG
SecWiki News
SecWiki News
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tor Project blog
Recorded Future
Recorded Future
A
About on SuperTechFans
J
Java Code Geeks
The Register - Security
The Register - Security
PCI Perspectives
PCI Perspectives
H
Hacker News: Front Page
V2EX - 技术
V2EX - 技术
S
Secure Thoughts
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
Y
Y Combinator Blog
AWS News Blog
AWS News Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
IT之家
IT之家
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
C
CERT Recently Published Vulnerability Notes
L
LangChain Blog
F
Full Disclosure
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The GitHub Blog
The GitHub 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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: dedupe migrate mock calls · openclaw/openclaw@6a5290e
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -197,6 +197,43 @@ function codexPluginPlan(overrides: Partial<MigrationPlan> = {}): MigrationPlan

197197

};

198198

}

199199200+

type MockCallSource = {

201+

mock: {

202+

calls: ReadonlyArray<ReadonlyArray<unknown>>;

203+

};

204+

};

205+206+

type MigrationSelectionPrompt = {

207+

initialValues?: unknown;

208+

message?: unknown;

209+

options?: Array<{ hint?: unknown; label?: unknown; value?: unknown }>;

210+

required?: unknown;

211+

};

212+213+

function mockCall(source: MockCallSource, callIndex = 0): ReadonlyArray<unknown> {

214+

const call = source.mock.calls.at(callIndex);

215+

if (!call) {

216+

throw new Error(`Expected mock call ${callIndex}`);

217+

}

218+

return call;

219+

}

220+221+

function mockArg(source: MockCallSource, callIndex: number, argIndex: number) {

222+

return mockCall(source, callIndex)[argIndex];

223+

}

224+225+

function multiselectPrompt(callIndex = 0): MigrationSelectionPrompt {

226+

return mockArg(mocks.multiselect, callIndex, 0) as MigrationSelectionPrompt;

227+

}

228+229+

function firstApplyContext(): Record<string, unknown> {

230+

return mockArg(mocks.provider.apply, 0, 0) as Record<string, unknown>;

231+

}

232+233+

function firstAppliedPlan(): MigrationPlan {

234+

return mockArg(mocks.provider.apply, 0, 1) as MigrationPlan;

235+

}

236+200237

const runtime: RuntimeEnv = {

201238

log: vi.fn(),

202239

error: vi.fn(),

@@ -268,8 +305,8 @@ describe("migrateApplyCommand", () => {

268305

expect(mocks.provider.plan).toHaveBeenCalledTimes(1);

269306

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

270307

expect(mocks.backupCreateCommand).toHaveBeenCalled();

271-

expect(typeof mocks.provider.apply.mock.calls.at(0)?.[0]).toBe("object");

272-

expect(mocks.provider.apply.mock.calls.at(0)?.[1]).toBe(planned);

308+

expect(typeof firstApplyContext()).toBe("object");

309+

expect(firstAppliedPlan()).toBe(planned);

273310

});

274311275312

it("prompts for Codex skills before interactive default apply", async () => {

@@ -291,26 +328,19 @@ describe("migrateApplyCommand", () => {

291328292329

await migrateDefaultCommand(runtime, { provider: "codex" });

293330294-

const selectionPrompt = mocks.multiselect.mock.calls.at(0)?.[0] as

295-

| {

296-

initialValues?: unknown;

297-

message?: unknown;

298-

options?: Array<{ label?: unknown; value?: unknown }>;

299-

required?: unknown;

300-

}

301-

| undefined;

302-

expect(String(selectionPrompt?.message)).toContain("Select Codex skills");

303-

expect(selectionPrompt?.initialValues).toStrictEqual(["skill:alpha", "skill:beta"]);

304-

expect(selectionPrompt?.required).toBe(false);

305-

expect(selectionPrompt?.options?.map(({ label, value }) => ({ label, value }))).toStrictEqual([

331+

const selectionPrompt = multiselectPrompt();

332+

expect(String(selectionPrompt.message)).toContain("Select Codex skills");

333+

expect(selectionPrompt.initialValues).toStrictEqual(["skill:alpha", "skill:beta"]);

334+

expect(selectionPrompt.required).toBe(false);

335+

expect(selectionPrompt.options?.map(({ label, value }) => ({ label, value }))).toStrictEqual([

306336

{ value: MIGRATION_SKILL_SELECTION_SKIP, label: "Skip for now" },

307337

{ value: MIGRATION_SKILL_SELECTION_TOGGLE_ALL_ON, label: "Toggle all on" },

308338

{ value: MIGRATION_SKILL_SELECTION_TOGGLE_ALL_OFF, label: "Toggle all off" },

309339

{ value: "skill:alpha", label: "alpha" },

310340

{ value: "skill:beta", label: "beta" },

311341

]);

312342

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

313-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

343+

const appliedPlan = firstAppliedPlan();

314344

expect(appliedPlan.summary.planned).toBe(2);

315345

expect(appliedPlan.summary.skipped).toBe(1);

316346

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -356,30 +386,21 @@ describe("migrateApplyCommand", () => {

356386

await migrateDefaultCommand(runtime, { provider: "codex" });

357387358388

expect(mocks.multiselect).toHaveBeenCalledTimes(2);

359-

const skillPrompt = mocks.multiselect.mock.calls.at(0)?.[0] as

360-

| { message?: unknown }

361-

| undefined;

362-

expect(String(skillPrompt?.message)).toContain("Select Codex skills");

363-

const pluginPrompt = mocks.multiselect.mock.calls.at(1)?.[0] as

364-

| {

365-

initialValues?: unknown;

366-

message?: unknown;

367-

options?: Array<{ label?: unknown; value?: unknown }>;

368-

required?: unknown;

369-

}

370-

| undefined;

371-

expect(String(pluginPrompt?.message)).toContain("Select native Codex plugins");

372-

expect(pluginPrompt?.initialValues).toStrictEqual(["plugin:google-calendar", "plugin:gmail"]);

373-

expect(pluginPrompt?.required).toBe(false);

374-

expect(pluginPrompt?.options?.map(({ label, value }) => ({ label, value }))).toStrictEqual([

389+

const skillPrompt = multiselectPrompt();

390+

expect(String(skillPrompt.message)).toContain("Select Codex skills");

391+

const pluginPrompt = multiselectPrompt(1);

392+

expect(String(pluginPrompt.message)).toContain("Select native Codex plugins");

393+

expect(pluginPrompt.initialValues).toStrictEqual(["plugin:google-calendar", "plugin:gmail"]);

394+

expect(pluginPrompt.required).toBe(false);

395+

expect(pluginPrompt.options?.map(({ label, value }) => ({ label, value }))).toStrictEqual([

375396

{ value: MIGRATION_SKILL_SELECTION_SKIP, label: "Skip for now" },

376397

{ value: MIGRATION_SKILL_SELECTION_TOGGLE_ALL_ON, label: "Toggle all on" },

377398

{ value: MIGRATION_SKILL_SELECTION_TOGGLE_ALL_OFF, label: "Toggle all off" },

378399

{ value: "plugin:google-calendar", label: "google-calendar" },

379400

{ value: "plugin:gmail", label: "gmail" },

380401

]);

381402

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

382-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

403+

const appliedPlan = firstAppliedPlan();

383404

expect(appliedPlan.summary.planned).toBe(4);

384405

expect(appliedPlan.summary.skipped).toBe(2);

385406

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -439,12 +460,10 @@ describe("migrateApplyCommand", () => {

439460440461

await migrateDefaultCommand(runtime, { provider: "codex" });

441462442-

const pluginPrompt = mocks.multiselect.mock.calls.at(1)?.[0] as

443-

| { initialValues?: unknown; message?: unknown }

444-

| undefined;

445-

expect(String(pluginPrompt?.message)).toContain("Select native Codex plugins");

446-

expect(pluginPrompt?.initialValues).toStrictEqual(["plugin:google-calendar", "plugin:gmail"]);

447-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

463+

const pluginPrompt = multiselectPrompt(1);

464+

expect(String(pluginPrompt.message)).toContain("Select native Codex plugins");

465+

expect(pluginPrompt.initialValues).toStrictEqual(["plugin:google-calendar", "plugin:gmail"]);

466+

const appliedPlan = firstAppliedPlan();

448467

expect(appliedPlan.summary.planned).toBe(4);

449468

expect(appliedPlan.summary.skipped).toBe(2);

450469

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -503,22 +522,16 @@ describe("migrateApplyCommand", () => {

503522504523

await migrateDefaultCommand(runtime, { provider: "codex" });

505524506-

const pluginPrompt = mocks.multiselect.mock.calls.at(0)?.[0] as

507-

| {

508-

initialValues?: unknown;

509-

message?: unknown;

510-

options?: Array<{ hint?: unknown; label?: unknown; value?: unknown }>;

511-

}

512-

| undefined;

513-

expect(String(pluginPrompt?.message)).toContain("Select native Codex plugins");

514-

expect(pluginPrompt?.initialValues).toStrictEqual(["plugin:gmail"]);

515-

const optionsByValue = new Map(pluginPrompt?.options?.map((option) => [option.value, option]));

525+

const pluginPrompt = multiselectPrompt();

526+

expect(String(pluginPrompt.message)).toContain("Select native Codex plugins");

527+

expect(pluginPrompt.initialValues).toStrictEqual(["plugin:gmail"]);

528+

const optionsByValue = new Map(pluginPrompt.options?.map((option) => [option.value, option]));

516529

expect(optionsByValue.get("plugin:google-calendar")?.label).toBe("google-calendar");

517530

expect(String(optionsByValue.get("plugin:google-calendar")?.hint)).toContain(

518531

"conflict: plugin exists",

519532

);

520533

expect(optionsByValue.get("plugin:gmail")?.label).toBe("gmail");

521-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

534+

const appliedPlan = firstAppliedPlan();

522535

expect(appliedPlan.summary.planned).toBe(2);

523536

expect(appliedPlan.summary.skipped).toBe(1);

524537

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -592,10 +605,8 @@ describe("migrateApplyCommand", () => {

592605593606

const result = await migrateDefaultCommand(runtime, { provider: "codex" });

594607595-

const pluginPrompt = mocks.multiselect.mock.calls.at(0)?.[0] as

596-

| { message?: unknown }

597-

| undefined;

598-

expect(String(pluginPrompt?.message)).toContain("Select native Codex plugins");

608+

const pluginPrompt = multiselectPrompt();

609+

expect(String(pluginPrompt.message)).toContain("Select native Codex plugins");

599610

expect(mocks.promptYesNo).not.toHaveBeenCalled();

600611

expect(mocks.backupCreateCommand).not.toHaveBeenCalled();

601612

expect(mocks.provider.apply).not.toHaveBeenCalled();

@@ -634,7 +645,7 @@ describe("migrateApplyCommand", () => {

634645635646

expect(mocks.multiselect).not.toHaveBeenCalled();

636647

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

637-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

648+

const appliedPlan = firstAppliedPlan();

638649

expect(appliedPlan.summary.planned).toBe(2);

639650

expect(appliedPlan.summary.skipped).toBe(1);

640651

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -689,15 +700,10 @@ describe("migrateApplyCommand", () => {

689700690701

await migrateDefaultCommand(runtime, { provider: "codex" });

691702692-

const skillPrompt = mocks.multiselect.mock.calls.at(0)?.[0] as

693-

| {

694-

initialValues?: unknown;

695-

options?: Array<{ label?: unknown; value?: unknown }>;

696-

}

697-

| undefined;

698-

expect(skillPrompt?.initialValues).toStrictEqual(["skill:alpha"]);

703+

const skillPrompt = multiselectPrompt();

704+

expect(skillPrompt.initialValues).toStrictEqual(["skill:alpha"]);

699705

const skillOptionsByValue = new Map(

700-

skillPrompt?.options?.map((option) => [option.value, option]),

706+

skillPrompt.options?.map((option) => [option.value, option]),

701707

);

702708

expect(skillOptionsByValue.get("skill:beta")?.label).toBe("beta");

703709

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

@@ -741,7 +747,7 @@ describe("migrateApplyCommand", () => {

741747

expect(mocks.multiselect).toHaveBeenCalledTimes(2);

742748

expect(runtime.log).toHaveBeenCalledWith("Codex skill migration skipped for now.");

743749

expect(mocks.promptYesNo).toHaveBeenCalledWith("Apply this migration now?", false);

744-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

750+

const appliedPlan = firstAppliedPlan();

745751

expect(appliedPlan.summary.planned).toBe(3);

746752

expect(appliedPlan.summary.skipped).toBe(3);

747753

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -802,7 +808,7 @@ describe("migrateApplyCommand", () => {

802808803809

await migrateDefaultCommand(runtime, { provider: "codex" });

804810805-

let appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

811+

let appliedPlan = firstAppliedPlan();

806812

expect(appliedPlan.summary.planned).toBe(3);

807813

expect(appliedPlan.summary.skipped).toBe(0);

808814

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -983,7 +989,7 @@ describe("migrateApplyCommand", () => {

983989984990

await migrateApplyCommand(runtime, { provider: "codex", yes: true, skills: ["alpha"] });

985991986-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

992+

const appliedPlan = firstAppliedPlan();

987993

expect(appliedPlan.summary.planned).toBe(2);

988994

expect(appliedPlan.summary.skipped).toBe(1);

989995

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -1007,7 +1013,7 @@ describe("migrateApplyCommand", () => {

1007101310081014

await migrateApplyCommand(runtime, { provider: "codex", yes: true, plugins: ["gmail"] });

100910151010-

const appliedPlan = mocks.provider.apply.mock.calls.at(0)?.[1] as MigrationPlan;

1016+

const appliedPlan = firstAppliedPlan();

10111017

expect(appliedPlan.summary.planned).toBe(2);

10121018

expect(appliedPlan.summary.skipped).toBe(1);

10131019

expect(appliedPlan.summary.conflicts).toBe(0);

@@ -1031,15 +1037,13 @@ describe("migrateApplyCommand", () => {

1031103710321038

const result = await migrateApplyCommand(runtime, { provider: "hermes", yes: true });

103310391034-

const backupCall = mocks.backupCreateCommand.mock.calls.at(0);

1040+

const backupCall = mockCall(mocks.backupCreateCommand);

10351041

expect(typeof (backupCall?.[0] as { log?: unknown } | undefined)?.log).toBe("function");

10361042

expect(backupCall?.[1]).toStrictEqual({ output: undefined, verify: true });

1037-

const applyContext = mocks.provider.apply.mock.calls.at(0)?.[0] as

1038-

| { backupPath?: unknown; reportDir?: unknown }

1039-

| undefined;

1040-

expect(applyContext?.backupPath).toBe("/tmp/openclaw-backup.tgz");

1041-

expect(String(applyContext?.reportDir)).toContain("/migration/hermes/");

1042-

expect(mocks.provider.apply.mock.calls.at(0)?.[1]).toBe(planned);

1043+

const applyContext = firstApplyContext();

1044+

expect(applyContext.backupPath).toBe("/tmp/openclaw-backup.tgz");

1045+

expect(String(applyContext.reportDir)).toContain("/migration/hermes/");

1046+

expect(firstAppliedPlan()).toBe(planned);

10431047

expect(result.backupPath).toBe("/tmp/openclaw-backup.tgz");

10441048

});

10451049

@@ -1150,8 +1154,8 @@ describe("migrateApplyCommand", () => {

11501154

await migrateDefaultCommand(runtime, { provider: "hermes", yes: true });

1151115511521156

expect(mocks.provider.plan).toHaveBeenCalledTimes(1);

1153-

expect(typeof mocks.provider.apply.mock.calls.at(0)?.[0]).toBe("object");

1154-

expect(mocks.provider.apply.mock.calls.at(0)?.[1]).toBe(planned);

1157+

expect(typeof firstApplyContext()).toBe("object");

1158+

expect(firstAppliedPlan()).toBe(planned);

11551159

});

1156116011571161

it("fails after writing JSON output when apply reports item errors", async () => {