fix(events): restrict pipeline routes and load agent prompts

This commit is contained in:
Hyu
2026-10-09 21:22:34 +08:00
parent ce3a9020af
commit 96280b3bcc
14 changed files with 69 additions and 13 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ from .tenant import TenantContext, require_workspace_uuid, scope_statement
AGENT_KIND_AGENT = 'agent'
AGENT_KIND_PIPELINE = 'pipeline'
AGENT_KIND_EVENT_PROCESSOR = 'event_processor'
PIPELINE_EVENT_PATTERNS = ['message.*']
PIPELINE_EVENT_PATTERNS = ['message.received']
AGENT_DEFAULT_EVENT_PATTERNS = ['*']
+2 -2
View File
@@ -64,7 +64,7 @@ class BotService:
@staticmethod
def _is_message_event_pattern(event_pattern: str) -> bool:
return event_pattern == 'message.*' or event_pattern.startswith('message.')
return event_pattern == 'message.received'
@staticmethod
def _event_pattern_covers(supported_pattern: str, binding_pattern: str) -> bool:
@@ -507,7 +507,7 @@ class BotService:
if target_type == 'pipeline':
if not self._is_message_event_pattern(event_pattern):
raise ValueError('Pipeline can only be bound to message events')
raise ValueError('Pipeline can only be bound to message.received')
result = await self.ap.persistence_mgr.execute_async(
scope_statement(
sqlalchemy.select(persistence_pipeline.LegacyPipeline.uuid).where(