@@ -25,8 +25,10 @@ import {
2525 verifyNpmProvenanceAttestation ,
2626 verifyNpmRegistrySignatures ,
2727} from "../scripts/openclaw-npm-postpublish-verify.ts" ;
28+ import { withEnv } from "../src/test-utils/env.js" ;
2829
2930const INSTALLED_ROOT_DIST_JS_FILE_SCAN_LIMIT = 10_000 ;
31+ const requiredBundledPluginPackPaths = listBundledPluginPackArtifacts ( ) ;
3032
3133describe ( "parseOpenClawNpmPostpublishVerifyArgs" , ( ) => {
3234 it ( "keeps trusted release verification independent from target app dependencies" , ( ) => {
@@ -571,7 +573,7 @@ describe("collectInstalledPackageErrors", () => {
571573 omittedIds : readonly string [ ] = [ ] ,
572574 ) : void {
573575 const omitted = new Set ( omittedIds ) ;
574- for ( const relativePath of listBundledPluginPackArtifacts ( ) ) {
576+ for ( const relativePath of requiredBundledPluginPackPaths ) {
575577 const match = / ^ d i s t \/ e x t e n s i o n s \/ ( [ ^ / ] + ) \/ p a c k a g e \. j s o n $ / u. exec ( relativePath ) ;
576578 if ( ! match || omitted . has ( match [ 1 ] ?? "" ) ) {
577579 continue ;
@@ -656,6 +658,35 @@ describe("collectInstalledPackageErrors", () => {
656658 }
657659 } ) ;
658660
661+ it ( "keeps bundled manifest requirements stable after the build filter changes" , ( ) => {
662+ const packageRoot = makeInstalledPackageRoot ( ) ;
663+
664+ try {
665+ const expectedErrors = collectInstalledBundledExtensionManifestErrors ( packageRoot ) ;
666+ const filteredErrors = withEnv ( { OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS : "ollama" } , ( ) =>
667+ collectInstalledBundledExtensionManifestErrors ( packageRoot ) ,
668+ ) ;
669+
670+ expect ( filteredErrors ) . toStrictEqual ( expectedErrors ) ;
671+ expect ( filteredErrors ) . toEqual (
672+ expect . arrayContaining (
673+ [ "ollama" , "lmstudio" ] . map (
674+ ( providerId ) =>
675+ `installed bundled extension manifest missing: ${ join (
676+ packageRoot ,
677+ "dist" ,
678+ "extensions" ,
679+ providerId ,
680+ "package.json" ,
681+ ) } .`,
682+ ) ,
683+ ) ,
684+ ) ;
685+ } finally {
686+ rmSync ( packageRoot , { recursive : true , force : true } ) ;
687+ }
688+ } ) ;
689+
659690 it ( "does not require excluded external or private plugin package manifests" , ( ) => {
660691 const packageRoot = makeInstalledPackageRoot ( ) ;
661692
0 commit comments