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

推荐订阅源

罗磊的独立博客
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
量子位
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
Jina AI
Jina AI
L
LangChain Blog
M
MIT News - Artificial intelligence
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学

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
fix: reject manifestless plugin archives · openclaw/openc...
shakkernerd · 2026-04-26 · via Recent Commits to openclaw:main

@@ -117,10 +117,6 @@ async function packToArchive({

117117

return dest;

118118

}

119119120-

function readVoiceCallArchiveBuffer(version: string): Buffer {

121-

return fs.readFileSync(path.join(pluginFixturesDir, `voice-call-${version}.tgz`));

122-

}

123-124120

function getArchiveFixturePath(params: {

125121

cacheKey: string;

126122

outName: string;

@@ -140,8 +136,6 @@ function readZipperArchiveBuffer(): Buffer {

140136

return fs.readFileSync(path.join(pluginFixturesDir, "zipper-0.0.1.zip"));

141137

}

142138143-

const VOICE_CALL_ARCHIVE_V1_BUFFER = readVoiceCallArchiveBuffer("0.0.1");

144-

const VOICE_CALL_ARCHIVE_V2_BUFFER = readVoiceCallArchiveBuffer("0.0.2");

145139

const ZIPPER_ARCHIVE_BUFFER = readZipperArchiveBuffer();

146140147141

function expectPluginFiles(result: { targetDir: string }, stateDir: string, pluginId: string) {

@@ -430,13 +424,17 @@ async function installArchivePackageAndReturnResult(params: {

430424

outName: string;

431425

withDistIndex?: boolean;

432426

flatRoot?: boolean;

427+

writePluginManifest?: boolean;

428+

manifestId?: string;

433429

}) {

434430

const stateDir = suiteTempRootTracker.makeTempDir();

435431

const archivePath = await ensureDynamicArchiveTemplate({

436432

outName: params.outName,

437433

packageJson: params.packageJson,

438434

withDistIndex: params.withDistIndex === true,

439435

flatRoot: params.flatRoot === true,

436+

writePluginManifest: params.writePluginManifest,

437+

manifestId: params.manifestId,

440438

});

441439442440

const extensionsDir = path.join(stateDir, "extensions");

@@ -452,12 +450,16 @@ function buildDynamicArchiveTemplateKey(params: {

452450

withDistIndex: boolean;

453451

distIndexJsContent?: string;

454452

flatRoot: boolean;

453+

writePluginManifest?: boolean;

454+

manifestId?: string;

455455

}): string {

456456

return JSON.stringify({

457457

packageJson: params.packageJson,

458458

withDistIndex: params.withDistIndex,

459459

distIndexJsContent: params.distIndexJsContent ?? null,

460460

flatRoot: params.flatRoot,

461+

writePluginManifest: params.writePluginManifest ?? true,

462+

manifestId: params.manifestId ?? null,

461463

});

462464

}

463465

@@ -467,12 +469,16 @@ async function ensureDynamicArchiveTemplate(params: {

467469

withDistIndex: boolean;

468470

distIndexJsContent?: string;

469471

flatRoot?: boolean;

472+

writePluginManifest?: boolean;

473+

manifestId?: string;

470474

}): Promise<string> {

471475

const templateKey = buildDynamicArchiveTemplateKey({

472476

packageJson: params.packageJson,

473477

withDistIndex: params.withDistIndex,

474478

distIndexJsContent: params.distIndexJsContent,

475479

flatRoot: params.flatRoot === true,

480+

writePluginManifest: params.writePluginManifest,

481+

manifestId: params.manifestId,

476482

});

477483

const cachedPath = dynamicArchiveTemplatePathCache.get(templateKey);

478484

if (cachedPath) {

@@ -490,6 +496,18 @@ async function ensureDynamicArchiveTemplate(params: {

490496

);

491497

}

492498

fs.writeFileSync(path.join(pkgDir, "package.json"), JSON.stringify(params.packageJson), "utf-8");

499+

if (params.writePluginManifest !== false) {

500+

const packageName =

501+

typeof params.packageJson.name === "string" ? params.packageJson.name : "fixture-plugin";

502+

fs.writeFileSync(

503+

path.join(pkgDir, "openclaw.plugin.json"),

504+

JSON.stringify({

505+

id: params.manifestId ?? packageName,

506+

configSchema: { type: "object", properties: {} },

507+

}),

508+

"utf-8",

509+

);

510+

}

493511

const archivePath = await packToArchive({

494512

pkgDir,

495513

outDir: ensureSuiteFixtureRoot(),

@@ -578,15 +596,23 @@ beforeEach(() => {

578596

describe("installPluginFromArchive", () => {

579597

it("installs scoped archives, rejects duplicate installs, and allows updates", async () => {

580598

const stateDir = suiteTempRootTracker.makeTempDir();

581-

const archiveV1 = getArchiveFixturePath({

582-

cacheKey: "voice-call:0.0.1",

599+

const archiveV1 = await ensureDynamicArchiveTemplate({

583600

outName: "voice-call-0.0.1.tgz",

584-

buffer: VOICE_CALL_ARCHIVE_V1_BUFFER,

601+

packageJson: {

602+

name: "@openclaw/voice-call",

603+

version: "0.0.1",

604+

openclaw: { extensions: ["./dist/index.js"] },

605+

},

606+

withDistIndex: true,

585607

});

586-

const archiveV2 = getArchiveFixturePath({

587-

cacheKey: "voice-call:0.0.2",

608+

const archiveV2 = await ensureDynamicArchiveTemplate({

588609

outName: "voice-call-0.0.2.tgz",

589-

buffer: VOICE_CALL_ARCHIVE_V2_BUFFER,

610+

packageJson: {

611+

name: "@openclaw/voice-call",

612+

version: "0.0.2",

613+

openclaw: { extensions: ["./dist/index.js"] },

614+

},

615+

withDistIndex: true,

590616

});

591617592618

const extensionsDir = path.join(stateDir, "extensions");

@@ -620,7 +646,7 @@ describe("installPluginFromArchive", () => {

620646

expect(manifest.version).toBe("0.0.2");

621647

});

622648623-

it("installs from a zip archive", async () => {

649+

it("rejects native plugin zip archives without openclaw.plugin.json", async () => {

624650

const stateDir = suiteTempRootTracker.makeTempDir();

625651

const archivePath = getArchiveFixturePath({

626652

cacheKey: "zipper:0.0.1",

@@ -633,7 +659,12 @@ describe("installPluginFromArchive", () => {

633659

archivePath,

634660

extensionsDir,

635661

});

636-

expectSuccessfulArchiveInstall({ result, stateDir, pluginId: "@openclaw/zipper" });

662+

expect(result.ok).toBe(false);

663+

if (!result.ok) {

664+

expect(result.error).toContain("package missing valid openclaw.plugin.json");

665+

expect(result.code).toBe(PLUGIN_INSTALL_ERROR_CODE.MISSING_PLUGIN_MANIFEST);

666+

}

667+

expect(fs.existsSync(resolvePluginInstallDir("@openclaw/zipper", extensionsDir))).toBe(false);

637668

});

638669639670

it("allows archive installs with dangerous code patterns when forced unsafe install is set", async () => {