Lightweight containerized prosody tooling + moved auth scripts + xmpp reconnect/auth stabilization
This commit is contained in:
@@ -20,6 +20,8 @@ from core.models import (
|
||||
TaskEpic,
|
||||
TaskProviderConfig,
|
||||
)
|
||||
from core.tasks.chat_defaults import ensure_default_source_for_chat, resolve_message_scope
|
||||
from core.tasks.codex_approval import queue_codex_event_with_pre_approval
|
||||
from core.tasks.providers import get_provider
|
||||
from core.tasks.codex_support import resolve_external_chat_id
|
||||
|
||||
@@ -355,6 +357,17 @@ async def _emit_sync_event(task: DerivedTask, event: DerivedTaskEvent, action: s
|
||||
|
||||
# Worker-backed providers are queued and executed by `manage.py codex_worker`.
|
||||
if bool(getattr(provider, "run_in_worker", False)):
|
||||
if provider_name == "codex_cli":
|
||||
await sync_to_async(queue_codex_event_with_pre_approval)(
|
||||
user=task.user,
|
||||
run=codex_run,
|
||||
task=task,
|
||||
task_event=event,
|
||||
action=action,
|
||||
provider_payload=dict(request_payload),
|
||||
idempotency_key=idempotency_key,
|
||||
)
|
||||
return
|
||||
await sync_to_async(ExternalSyncEvent.objects.update_or_create)(
|
||||
idempotency_key=idempotency_key,
|
||||
defaults={
|
||||
@@ -526,6 +539,15 @@ async def _handle_epic_create_command(message: Message, sources: list[ChatTaskSo
|
||||
return True
|
||||
|
||||
|
||||
def _is_task_command_candidate(text: str) -> bool:
|
||||
body = str(text or "").strip()
|
||||
if not body:
|
||||
return False
|
||||
if _LIST_TASKS_RE.match(body) or _UNDO_TASK_RE.match(body) or _EPIC_CREATE_RE.match(body):
|
||||
return True
|
||||
return _has_task_prefix(body.lower(), ["task:", "todo:"])
|
||||
|
||||
|
||||
async def process_inbound_task_intelligence(message: Message) -> None:
|
||||
if message is None:
|
||||
return
|
||||
@@ -537,7 +559,20 @@ async def process_inbound_task_intelligence(message: Message) -> None:
|
||||
|
||||
sources = await _resolve_source_mappings(message)
|
||||
if not sources:
|
||||
return
|
||||
if not _is_task_command_candidate(text):
|
||||
return
|
||||
service, channel = resolve_message_scope(message)
|
||||
if not service or not channel:
|
||||
return
|
||||
seeded = await sync_to_async(ensure_default_source_for_chat)(
|
||||
user=message.user,
|
||||
service=service,
|
||||
channel_identifier=channel,
|
||||
message=message,
|
||||
)
|
||||
if seeded is None:
|
||||
return
|
||||
sources = [seeded]
|
||||
if await _handle_scope_task_commands(message, sources, text):
|
||||
return
|
||||
if await _handle_epic_create_command(message, sources, text):
|
||||
|
||||
Reference in New Issue
Block a user