refactor(gateway): model external chat surfaces over canonical chats

This commit is contained in:
Anish Sarkar 2026-05-28 04:39:54 +05:30
parent afcadfb4bf
commit 2a41a157f7
4 changed files with 64 additions and 36 deletions

View file

@ -0,0 +1,16 @@
from __future__ import annotations
from app.tasks.celery_tasks import gateway_tasks
def test_enqueue_received_sweep_is_noop_guard(mocker):
apply_async = mocker.Mock()
mocker.patch.object(gateway_tasks.process_inbound_event_task, "apply_async", apply_async)
info = mocker.patch.object(gateway_tasks.logger, "info")
replayed = gateway_tasks.enqueue_received_sweep_task.run()
apply_async.assert_not_called()
assert replayed == 0
info.assert_called_once()

View file

@ -0,0 +1,13 @@
from __future__ import annotations
from app.tasks.celery_tasks import gateway_tasks
def test_process_inbound_event_task_is_noop_guard(mocker):
warning = mocker.patch.object(gateway_tasks.logger, "warning")
assert gateway_tasks.process_inbound_event_task.run(123) is None
warning.assert_called_once()
assert "FastAPI owns external chat agent turn processing" in warning.call_args.args[0]