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().
This commit is contained in:
+3
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user