Files
leocrm/app/plugins/builtins/system_notif/participant_handler.py
Agent Zero 727d86614e Security fixes: P0-P2 complete (22 fixes)
P0 (7): Auth-bypass removed, migrations fixed, plugin-upload disabled, RLS FORCE+WITH CHECK, plugin double-registration fixed, persistent volume, domain removed
P1 (11): User/tenant model, Redis centralized, worker separated, transactional outbox, XSS fixed, DMS chunked streaming, permissions unified, password reset, metrics secured, config/docs fixed, cross-tenant FK
P2 (4): Contact model normalized, cross-imports reduced 94%, commands+state machines for contacts/dms/mail/calendar, SPA path-traversal

8 new migrations, 99 unit tests, 13 commands, 8 contracts, 72 files changed
2026-07-25 21:03:46 +02:00

47 lines
1.4 KiB
Python

"""System participant handler — passive participant that only reads."""
from __future__ import annotations
import logging
from typing import Any
from app.plugins.builtins.kommunikation.contracts import ParticipantHandler
logger = logging.getLogger(__name__)
class SystemParticipantHandler(ParticipantHandler):
"""System participant — passive, does not respond to messages.
The system participant only sends messages triggered by system events
(handled in the plugin's event handlers). It does not respond to
user messages in the chat.
"""
def __init__(self, container: Any) -> None:
self._container = container
async def on_message_received(
self,
conversation_id: Any,
message: dict[str, Any],
conversation: dict[str, Any],
mentions: list[str],
context: dict[str, Any],
) -> list[dict[str, Any]] | None:
"""System is passive — does not respond to messages.
Users can interact with action_card buttons (open, archive) which
are handled via the frontend, not via new messages.
"""
return None
def get_participant_info(self) -> dict[str, Any]:
"""Return participant metadata."""
return {
"display_name": "System",
"avatar_url": None,
"capabilities": ["notifications", "action_cards"],
"description": "System-Benachrichtigungen",
}