Skip to content

Commit 749f839

Browse files
committed
fix: block gateway startup on plugin repair warnings
Signed-off-by: sallyom <[email protected]>
1 parent fbfd41e commit 749f839

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/commands/doctor-config-preflight.state-migration.test.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ describe("runDoctorConfigPreflight state migration", () => {
326326
expect(startupMigrationLeaseRelease).toHaveBeenCalledOnce();
327327
});
328328

329-
it("records the startup migration checkpoint when plugin repair warnings are nonblocking", async () => {
329+
it("blocks gateway readiness when plugin repair warnings remain", async () => {
330330
needsStartupMigrationCheckpoint.mockReturnValue(true);
331331
runPostCorePluginConvergence.mockResolvedValueOnce(
332332
makeStartupConvergenceResult({
@@ -339,16 +339,15 @@ describe("runDoctorConfigPreflight state migration", () => {
339339
}),
340340
);
341341

342-
await runDoctorConfigPreflight({
343-
migrateLegacyConfig: false,
344-
invalidConfigNote: false,
345-
requireStartupMigrationCheckpoint: true,
346-
});
342+
await expect(
343+
runDoctorConfigPreflight({
344+
migrateLegacyConfig: false,
345+
invalidConfigNote: false,
346+
requireStartupMigrationCheckpoint: true,
347+
}),
348+
).rejects.toThrow("Configured plugin discord is not installed");
347349

348-
expect(recordSuccessfulStartupMigrations).toHaveBeenCalledWith({
349-
env: process.env,
350-
lease: startupMigrationLease,
351-
});
350+
expect(recordSuccessfulStartupMigrations).not.toHaveBeenCalled();
352351
expect(note).toHaveBeenCalledWith(
353352
"- Configured plugin discord is not installed. Run `openclaw update repair` to retry plugin repair.",
354353
"Doctor warnings",

src/commands/doctor-config-preflight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async function runStartupUpgradeConvergence(params: {
135135
if (warnings.length > 0) {
136136
note(warnings.map((warning) => `- ${warning}`).join("\n"), "Doctor warnings");
137137
}
138-
return convergence.errored ? warnings : [];
138+
return warnings;
139139
}
140140

141141
function formatStartupMigrationFailure(params: { warnings: string[]; blockers: string[] }): string {

0 commit comments

Comments
 (0)