@@ -150,6 +150,46 @@ describe("syncMemoryWikiBridgeSources", () => {
150150 expect ( logLines ) . toHaveLength ( 2 ) ;
151151 } ) ;
152152
153+ it ( "imports bridge artifacts from legacy providers without agent ids" , async ( ) => {
154+ const workspaceDir = await createBridgeWorkspace ( "legacy-agentids-workspace" ) ;
155+ const { rootDir : vaultDir , config } = await createVault ( {
156+ rootDir : nextCaseRoot ( "legacy-agentids-vault" ) ,
157+ config : {
158+ vaultMode : "bridge" ,
159+ bridge : {
160+ enabled : true ,
161+ readMemoryArtifacts : true ,
162+ indexMemoryRoot : true ,
163+ } ,
164+ } ,
165+ } ) ;
166+ const memoryPath = path . join ( workspaceDir , "MEMORY.md" ) ;
167+ await fs . writeFile ( memoryPath , "# Durable Memory\n" , "utf8" ) ;
168+ registerBridgeArtifacts ( [
169+ {
170+ kind : "memory-root" ,
171+ workspaceDir,
172+ relativePath : "MEMORY.md" ,
173+ absolutePath : memoryPath ,
174+ contentType : "markdown" ,
175+ } as Omit < MemoryPluginPublicArtifact , "agentIds" > as MemoryPluginPublicArtifact ,
176+ ] ) ;
177+
178+ const appConfig : OpenClawConfig = {
179+ agents : {
180+ list : [ { id : "main" , default : true , workspace : workspaceDir } ] ,
181+ } ,
182+ } ;
183+
184+ const result = await syncMemoryWikiBridgeSources ( { config, appConfig } ) ;
185+
186+ expect ( result . importedCount ) . toBe ( 1 ) ;
187+ expect ( result . artifactCount ) . toBe ( 1 ) ;
188+ const page = await fs . readFile ( path . join ( vaultDir , result . pagePaths [ 0 ] ?? "" ) , "utf8" ) ;
189+ expect ( page ) . toContain ( "# Memory Bridge: MEMORY" ) ;
190+ expect ( page ) . toContain ( "- Agents: unknown" ) ;
191+ } ) ;
192+
153193 it ( "returns a no-op result outside bridge mode" , async ( ) => {
154194 const { config } = await createVault ( { rootDir : nextCaseRoot ( "isolated" ) } ) ;
155195
0 commit comments