From 812ccdeaf0e0fe8d315db299f88400c407fb56e3 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Fri, 3 Jul 2026 00:12:43 +0000 Subject: [PATCH] fix: add missing display_name to PluginModel creation in lifespan The PluginModel.display_name column is NOT NULL but was not set when auto-installing builtin plugins during app startup, causing IntegrityError. Fix mirrors the pattern used in registry.install(). --- app/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 142fe0d..9ec9e05 100644 --- a/app/main.py +++ b/app/main.py @@ -120,6 +120,7 @@ async def lifespan(app: FastAPI): # Create DB record for this builtin plugin plugin_record = PluginModel( name=name, + display_name=plugin.manifest.display_name, version=plugin.manifest.version, status="installed", active=True, @@ -186,7 +187,7 @@ def create_app() -> FastAPI: app.include_router(ai_copilot.router) app.include_router(workflows.router) - # ─── Register plugin routes (before SPA catch-all) ────────────────── + # ── Register plugin routes (before SPA catch-all) ──────────────── registry = get_registry() try: registry.discover_builtins() @@ -205,7 +206,7 @@ def create_app() -> FastAPI: except Exception as exc: logger.warning(f"Plugin discovery failed: {exc}") - # ─── Serve frontend static files (SPA) ─────────────────────────────── + # ── Serve frontend static files (SPA) ──────────────────────────── # Mount built frontend assets (JS, CSS, images) frontend_dist = os.path.join(os.path.dirname(__file__), "..", "frontend", "dist") if os.path.isdir(frontend_dist):