@@ -18,7 +18,7 @@ import {
1818} from "../../../plugins/test-helpers/fs-fixtures.js" ;
1919import * as stateDbReadOnly from "../../../state/openclaw-state-db-readonly.js" ;
2020import { runOpenClawStateWriteTransaction } from "../../../state/openclaw-state-db.js" ;
21- import { migratePluginRegistryForInstall } from "./plugin-registry-migration.js" ;
21+ import { migratePluginRegistryForDoctor } from "./plugin-registry-migration.js" ;
2222const tempDirs : string [ ] = [ ] ;
2323
2424afterEach ( ( ) => {
@@ -103,7 +103,7 @@ function expectSha256(value: unknown) {
103103}
104104
105105function requireMigratedIndex (
106- result : Awaited < ReturnType < typeof migratePluginRegistryForInstall > > ,
106+ result : Awaited < ReturnType < typeof migratePluginRegistryForDoctor > > ,
107107) : InstalledPluginIndex {
108108 if ( result . status !== "migrated" ) {
109109 throw new Error ( `Expected migration result to be migrated, got ${ result . status } ` ) ;
@@ -148,7 +148,7 @@ function insertStalePersistedIndexRow(stateDir: string, installRecordsJson = "{}
148148 ) ;
149149}
150150
151- describe ( "plugin registry install migration" , ( ) => {
151+ describe ( "doctor plugin registry migration" , ( ) => {
152152 it ( "stops migration with the original error when the shared registry read fails" , async ( ) => {
153153 const stateDir = makeTempDir ( ) ;
154154 const records = { authoritative :
{ source :
"npm" , spec :
"[email protected] " } } ; @@ -164,7 +164,7 @@ describe("plugin registry install migration", () => {
164164 const readConfig = vi . fn ( ( ) => ( { } ) ) ;
165165 await expect
166166 . soft (
167- migratePluginRegistryForInstall ( {
167+ migratePluginRegistryForDoctor ( {
168168 stateDir,
169169 readConfig,
170170 candidates : [ ] ,
@@ -185,7 +185,7 @@ describe("plugin registry install migration", () => {
185185 { env : { OPENCLAW_STATE_DIR : stateDir } } ,
186186 ) ;
187187 expect ( row ) . toMatchObject ( { updated_at_ms : 123 } ) ;
188- const restored = await migratePluginRegistryForInstall ( {
188+ const restored = await migratePluginRegistryForDoctor ( {
189189 stateDir,
190190 readConfig,
191191 candidates : [ ] ,
@@ -200,7 +200,7 @@ describe("plugin registry install migration", () => {
200200 await writePersistedInstalledPluginIndex ( createCurrentIndex ( ) , { stateDir } ) ;
201201 const readConfig = vi . fn ( async ( ) => ( { } ) ) ;
202202
203- const result = await migratePluginRegistryForInstall ( {
203+ const result = await migratePluginRegistryForDoctor ( {
204204 stateDir,
205205 readConfig,
206206 env : hermeticEnv ( ) ,
@@ -222,7 +222,7 @@ describe("plugin registry install migration", () => {
222222 fs . mkdirSync ( pluginDir , { recursive : true } ) ;
223223 insertStalePersistedIndexRow ( stateDir ) ;
224224
225- const result = await migratePluginRegistryForInstall ( {
225+ const result = await migratePluginRegistryForDoctor ( {
226226 stateDir,
227227 candidates : [ createCandidate ( pluginDir ) ] ,
228228 readConfig : async ( ) => ( { } ) ,
@@ -246,7 +246,7 @@ describe("plugin registry install migration", () => {
246246 insertStalePersistedIndexRow ( stateDir , installRecordsJson ) ;
247247
248248 await expect (
249- migratePluginRegistryForInstall ( {
249+ migratePluginRegistryForDoctor ( {
250250 stateDir,
251251 readConfig : async ( ) => ( { } ) ,
252252 env : hermeticEnv ( ) ,
@@ -283,7 +283,7 @@ describe("plugin registry install migration", () => {
283283 ) as OpenClawConfig ;
284284
285285 await expect (
286- migratePluginRegistryForInstall ( {
286+ migratePluginRegistryForDoctor ( {
287287 stateDir,
288288 readConfig : async ( ) => invalidConfig ,
289289 env : hermeticEnv ( ) ,
@@ -303,7 +303,7 @@ describe("plugin registry install migration", () => {
303303 fs . mkdirSync ( disabledDir , { recursive : true } ) ;
304304 fs . mkdirSync ( unusedBundledDir , { recursive : true } ) ;
305305
306- const result = await migratePluginRegistryForInstall ( {
306+ const result = await migratePluginRegistryForDoctor ( {
307307 stateDir,
308308 candidates : [
309309 createCandidate ( enabledDir , "enabled-demo" ) ,
@@ -344,7 +344,7 @@ describe("plugin registry install migration", () => {
344344 fs . mkdirSync ( openaiDir , { recursive : true } ) ;
345345 fs . mkdirSync ( unusedBundledDir , { recursive : true } ) ;
346346
347- const result = await migratePluginRegistryForInstall ( {
347+ const result = await migratePluginRegistryForDoctor ( {
348348 stateDir,
349349 candidates : [
350350 createCandidate ( openaiDir , "openai" , "bundled" , { enabledByDefault : true } ) ,
@@ -370,7 +370,7 @@ describe("plugin registry install migration", () => {
370370 fs . mkdirSync ( migrationDir , { recursive : true } ) ;
371371 fs . mkdirSync ( unusedBundledDir , { recursive : true } ) ;
372372
373- const result = await migratePluginRegistryForInstall ( {
373+ const result = await migratePluginRegistryForDoctor ( {
374374 stateDir,
375375 candidates : [
376376 createCandidate ( migrationDir , "migrate-demo" , "bundled" , {
@@ -399,7 +399,7 @@ describe("plugin registry install migration", () => {
399399 fs . mkdirSync ( openaiDir , { recursive : true } ) ;
400400 fs . mkdirSync ( unusedBundledDir , { recursive : true } ) ;
401401
402- const result = await migratePluginRegistryForInstall ( {
402+ const result = await migratePluginRegistryForDoctor ( {
403403 stateDir,
404404 candidates : [
405405 createCandidate ( openaiDir , "openai" , "bundled" ) ,
@@ -431,7 +431,7 @@ describe("plugin registry install migration", () => {
431431 fs . mkdirSync ( memoryDir , { recursive : true } ) ;
432432 fs . mkdirSync ( unusedBundledDir , { recursive : true } ) ;
433433
434- const result = await migratePluginRegistryForInstall ( {
434+ const result = await migratePluginRegistryForDoctor ( {
435435 stateDir,
436436 candidates : [
437437 createCandidate ( memoryDir , "memory-core" , "bundled" , {
@@ -467,7 +467,7 @@ describe("plugin registry install migration", () => {
467467 const stateDir = makeTempDir ( ) ;
468468 const readConfig = vi . fn ( async ( ) => ( { } ) ) ;
469469
470- const result = await migratePluginRegistryForInstall ( {
470+ const result = await migratePluginRegistryForDoctor ( {
471471 stateDir,
472472 dryRun : true ,
473473 readConfig,
@@ -488,7 +488,7 @@ describe("plugin registry install migration", () => {
488488 fs . mkdirSync ( pluginDir , { recursive : true } ) ;
489489 const candidate = createCandidate ( pluginDir ) ;
490490
491- const result = await migratePluginRegistryForInstall ( {
491+ const result = await migratePluginRegistryForDoctor ( {
492492 stateDir,
493493 candidates : [ candidate ] ,
494494 config : { } ,
@@ -514,7 +514,7 @@ describe("plugin registry install migration", () => {
514514 const pluginDir = path . join ( stateDir , "plugins" , "demo" ) ;
515515 fs . mkdirSync ( pluginDir , { recursive : true } ) ;
516516
517- const result = await migratePluginRegistryForInstall ( {
517+ const result = await migratePluginRegistryForDoctor ( {
518518 stateDir,
519519 candidates : [ createCandidate ( pluginDir , "demo" , "global" , { installOwner : "demo" } ) ] ,
520520 readConfig : async ( ) => ( {
@@ -561,7 +561,7 @@ describe("plugin registry install migration", () => {
561561 const stateDir = makeTempDir ( ) ;
562562 const pluginDir = path . join ( stateDir , "plugins" , "missing" ) ;
563563
564- const result = await migratePluginRegistryForInstall ( {
564+ const result = await migratePluginRegistryForDoctor ( {
565565 stateDir,
566566 candidates : [ ] ,
567567 readConfig : async ( ) => ( {
0 commit comments