fix(deps): use NULLIF for tenant_id cast in plugin activation check

current_setting returns empty string when tenant context is not set.
Casting empty string to uuid fails. Use NULLIF to convert to NULL.
This commit is contained in:
Agent Zero
2026-08-07 00:20:42 +02:00
parent e9f990b039
commit 0f4c872c72
+1 -1
View File
@@ -391,7 +391,7 @@ def require_active_plugin(plugin_name: str):
from sqlalchemy import text as sa_text
result = await db.execute(
sa_text("SELECT current_setting('app.current_tenant_id', true)::uuid")
sa_text("SELECT NULLIF(current_setting('app.current_tenant_id', true), '')::uuid")
)
tenant_id = result.scalar()