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

推荐订阅源

Martin Fowler
Martin Fowler
D
DataBreaches.Net
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
M
MIT News - Artificial intelligence
美团技术团队
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
有赞技术团队
有赞技术团队
L
LangChain Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
S
SegmentFault 最新的问题
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
B
Blog
I
InfoQ

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(codex-migrate): cover new preview/result format · op...
sjf · 2026-05-14 · via Recent Commits to openclaw:main

@@ -1,7 +1,7 @@

11

import { describe, expect, it } from "vitest";

22

import type { MigrationItem, MigrationPlan } from "../../plugins/types.js";

33

import { stripAnsi } from "../../terminal/ansi.js";

4-

import { formatMigrationPlan } from "./output.js";

4+

import { formatMigrationPreview, formatMigrationResult } from "./output.js";

5566

function skillItem(index: number): MigrationItem {

77

return {

@@ -29,6 +29,15 @@ function pluginItem(name: string): MigrationItem {

2929

};

3030

}

313132+

function configItem(): MigrationItem {

33+

return {

34+

id: "config:codex-plugins-root",

35+

kind: "config",

36+

action: "update",

37+

status: "planned",

38+

};

39+

}

40+3241

function plan(items: MigrationItem[]): MigrationPlan {

3342

return {

3443

providerId: "codex",

@@ -46,27 +55,61 @@ function plan(items: MigrationItem[]): MigrationPlan {

4655

};

4756

}

485749-

describe("formatMigrationPlan", () => {

50-

it("does not duplicate native Codex plugins when they are already visible", () => {

51-

const lines = formatMigrationPlan(

58+

describe("formatMigrationPreview", () => {

59+

it("groups items under per-kind headings", () => {

60+

const output = formatMigrationPreview(

5261

plan([skillItem(1), pluginItem("google-calendar"), pluginItem("gmail")]),

53-

).map(stripAnsi);

62+

)

63+

.map(stripAnsi)

64+

.join("\n");

65+66+

expect(output).toContain("Skills:");

67+

expect(output).toContain("Plugins:");

68+

expect(output).not.toContain("Native Codex plugins:");

69+

expect(output).toContain("• skill-1");

70+

expect(output).toContain("• google-calendar");

71+

expect(output).toContain("• gmail");

72+

});

73+74+

it("hides config items from display and excludes them from the count", () => {

75+

const output = formatMigrationPreview(plan([skillItem(1), configItem()]))

76+

.map(stripAnsi)

77+

.join("\n");

78+79+

expect(output).toContain("1 item, 0 conflicts, 0 sensitive items");

80+

expect(output).not.toContain("Config:");

81+

expect(output).not.toContain("codex-plugins-root");

82+

});

83+

});

84+85+

describe("formatMigrationResult", () => {

86+

it("renders a check glyph and (Migrated) for migrated items", () => {

87+

const output = formatMigrationResult(plan([{ ...skillItem(1), status: "migrated" }]))

88+

.map(stripAnsi)

89+

.join("\n");

90+91+

expect(output).toContain("✅");

92+

expect(output).toContain("(Migrated)");

93+

});

94+95+

it("humanizes known error reason codes", () => {

96+

const output = formatMigrationResult(

97+

plan([{ ...pluginItem("google-calendar"), status: "error", reason: "plugin_missing" }]),

98+

)

99+

.map(stripAnsi)

100+

.join("\n");

5410155-

expect(lines.join("\n")).not.toContain("Native Codex plugins:");

102+

expect(output).toContain("❌");

103+

expect(output).toContain("Plugin not found in the Codex marketplace.");

56104

});

5710558-

it("surfaces native Codex plugin names even when normal item output is truncated", () => {

59-

const lines = formatMigrationPlan(

60-

plan([

61-

...Array.from({ length: 30 }, (_, index) => skillItem(index + 1)),

62-

pluginItem("google-calendar"),

63-

pluginItem("gmail"),

64-

]),

65-

).map(stripAnsi);

106+

it("says (Skipped) for user-deselected skill/plugin items", () => {

107+

const output = formatMigrationResult(

108+

plan([{ ...skillItem(1), status: "skipped", reason: "not selected for migration" }]),

109+

)

110+

.map(stripAnsi)

111+

.join("\n");

6611267-

const output = lines.join("\n");

68-

expect(output).toContain("Native Codex plugins:\n- google-calendar\n- gmail");

69-

expect(output.indexOf("Native Codex plugins:")).toBeLessThan(output.indexOf("Items:"));

70-

expect(output).toContain("- ... 7 more");

113+

expect(output).toContain("(Skipped)");

71114

});

72115

});