fix: BUG-073 (broken imports), BUG-009 (contact folders id=None), BUG-014 (tags assign 500), BUG-016 (search performance use_ai), BUG-030 (user delete GRANT DELETE), BUG-052 (miniapps response), BUG-047 (approval_requests columns), BUG-037 (compliance refresh), prestart.sh GRANT DELETE
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-08-22 07:10:25 +02:00
parent 57f4f3daca
commit b05204db14
17 changed files with 2413 additions and 725 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ async def invalidate_session(redis: aioredis.Redis, session_id: str) -> None:
from sqlalchemy import delete
from app.core.db import get_session_factory
from app.models.session import SessionModel
from app.models.session import Session as SessionModel
factory = get_session_factory()
async with factory() as db:
await db.execute(
+1 -1
View File
@@ -190,7 +190,7 @@ async def list_miniapps(
from app.plugins.builtins.kommunikation.contracts import get_miniapp_registry
registry = get_miniapp_registry()
items = registry.list_apps()
return {"items": items, "total": len(items)}
return items
@router.post(
+2 -2
View File
@@ -186,7 +186,7 @@ async def assign_tag(
):
"""Assign a tag to an entity."""
tenant_id = uuid.UUID(current_user["tenant_id"])
user_id = uuid.UUID(current_user["id"])
user_id = uuid.UUID(current_user["user_id"])
tag_id = _parse_uuid(body.tag_id, "tag_id")
entity_id = _parse_uuid(body.entity_id, "entity_id")
@@ -247,7 +247,7 @@ async def unassign_tag(
):
"""Remove a tag assignment from an entity."""
tenant_id = uuid.UUID(current_user["tenant_id"])
user_id = uuid.UUID(current_user["id"])
user_id = uuid.UUID(current_user["user_id"])
tag_id = _parse_uuid(body.tag_id, "tag_id")
entity_id = _parse_uuid(body.entity_id, "entity_id")
+13 -4
View File
@@ -148,8 +148,13 @@ async def _do_search(
user_id = uuid.UUID(current_user["user_id"])
is_system_admin = current_user.get("is_system_admin", False)
# KI query understanding
query_analysis = await llm_analyze_query(req.query, db=db, tenant_id=tenant_id)
# KI query understanding (skip if use_ai=False for performance)
use_ai = getattr(req, "use_ai", True)
if use_ai:
query_analysis = await llm_analyze_query(req.query, db=db, tenant_id=tenant_id)
else:
from app.plugins.builtins.unified_search.query_understanding import _fallback_query_analysis
query_analysis = _fallback_query_analysis(req.query)
# Hybrid search with visibility filtering
results = await hybrid_search(
@@ -176,8 +181,12 @@ async def _do_search(
"event": "calendar",
}
# KI result aggregation
aggregation = await llm_aggregate_results(results, req.query, db=db, tenant_id=tenant_id)
# KI result aggregation (skip if use_ai=False for performance)
if use_ai:
aggregation = await llm_aggregate_results(results, req.query, db=db, tenant_id=tenant_id)
else:
from app.plugins.builtins.unified_search.query_understanding import _fallback_aggregate
aggregation = _fallback_aggregate(results, req.query)
search_results = [
SearchResult(
+3 -3
View File
@@ -330,10 +330,10 @@ async def create_incident(
changes={"title": body.title, "incident_type": body.incident_type, "status": body.status},
)
db.add(audit)
await db.flush()
result = _incident_to_dict(incident)
await db.commit()
await db.refresh(incident)
return _incident_to_dict(incident)
return result
@router.patch(
+6 -6
View File
@@ -473,7 +473,7 @@ async def approve_workflow_step(
body = {}
comment = body.get("comment", "")
from app.core.approval import create_approval_request, decide_approval
from app.core.approval import create_approval_request, resolve_approval_request
from app.models.workflow import WorkflowInstance
from sqlalchemy import select
@@ -500,9 +500,9 @@ async def approve_workflow_step(
requested_by=user_id,
requested_by_type="user",
)
await decide_approval(
await resolve_approval_request(
db=db,
approval_id=approval["id"],
request_id=approval["id"],
decision="approved",
decided_by=user_id,
comment=comment,
@@ -536,7 +536,7 @@ async def reject_workflow_step(
body = {}
comment = body.get("comment", "")
from app.core.approval import create_approval_request, decide_approval
from app.core.approval import create_approval_request, resolve_approval_request
from app.models.workflow import WorkflowInstance
from sqlalchemy import select
@@ -563,9 +563,9 @@ async def reject_workflow_step(
requested_by=user_id,
requested_by_type="user",
)
await decide_approval(
await resolve_approval_request(
db=db,
approval_id=approval["id"],
request_id=approval["id"],
decision="rejected",
decided_by=user_id,
comment=comment,
+1
View File
@@ -110,6 +110,7 @@ async def create_folder(
sort_order=max_order + 1,
)
db.add(folder)
await db.flush()
result = _serialize_folder(folder)
await db.commit()
return result
+5 -4
View File
@@ -444,14 +444,15 @@ async def _handle_crm(
result = await update_contact(db, tenant_id, uuid.UUID(entity_id), data)
return StepResult(output={"contact": result} if result else {})
elif action == "create_company":
from app.services.company_service import create_company
result = await create_company(db, tenant_id, data)
from app.services.contact_service import create_contact
company_data = {**data, "type": "company"}
result = await create_contact(db, tenant_id, company_data)
return StepResult(output={"company": result} if result else {})
elif action == "update_company":
from app.services.company_service import update_company
from app.services.contact_service import update_contact
if not entity_id:
return StepResult(error="update_company requires entity_id", abort=True)
result = await update_company(db, tenant_id, uuid.UUID(entity_id), data)
result = await update_contact(db, tenant_id, uuid.UUID(entity_id), data)
return StepResult(output={"company": result} if result else {})
else:
return StepResult(error=f"unknown crm action: {action}", abort=True)