Commit graph

31 commits

Author SHA1 Message Date
CREDO23
b9937cf4b1 refactor(chat): cut live chat streaming over to flows orchestrators (cutover)
Flip the live callers (new_chat_routes + gateway/agent_invoke) from the
legacy monolithic app.tasks.chat.stream_new_chat to the side-by-side
app.tasks.chat.streaming.flows orchestrators.

Adds a byte-for-byte differential parity test driving BOTH implementations
on identical, fully-deterministic glue inputs (frozen time/uuid, stubbed
LLM/persistence/agent seams). All glue paths are byte-identical:
  * new: auto-pin failure, LLM-load failure, persist-user fail,
    persist-assistant fail (full initial-frame ordering + handshake),
    pre-stream exception (top-level except path)
  * resume: persist-assistant fail

The differential test also surfaced one INTENTIONAL divergence: on a resume
turn whose auto-pin / LLM-load fails, the monolith crashes with
UnboundLocalError (_resume_premium_request_id read in finally before its
post-early-return definition); the flows version emits a clean terminal
error. The flows path is therefore byte-identical or strictly more correct.

The agent-content stream itself is shared, unforkable code
(stream_output -> EventRelay) so it cannot diverge.

Monolith + old parity test deletion follows in a separate commit.
2026-06-04 14:24:18 +02:00
Anish Sarkar
fc2467be3d feat(gateway): improve WhatsApp account mode handling and connection filtering 2026-06-01 23:08:56 +05:30
Anish Sarkar
05eaa46c3a feat(gateway): add Discord mention intake supervisor 2026-06-01 20:59:21 +05:30
Anish Sarkar
f8ff58bdce feat(gateway): route Discord events through external chat 2026-06-01 20:59:13 +05:30
Anish Sarkar
5024b69e69 feat(gateway): handle Discord channel replies 2026-06-01 20:59:04 +05:30
Anish Sarkar
bc8a285187 feat(gateway): add Discord platform adapter 2026-06-01 20:58:50 +05:30
Anish Sarkar
68da295b5d feat(gateway): add Discord gateway configuration 2026-06-01 20:58:31 +05:30
Anish Sarkar
f305a2e67d feat(gateway): route Slack events through external chat 2026-06-01 12:36:53 +05:30
Anish Sarkar
61a3586caf feat(gateway): handle Slack thread replies 2026-06-01 12:36:39 +05:30
Anish Sarkar
78315eb55b feat(gateway): add Slack platform adapter 2026-06-01 12:36:27 +05:30
Anish Sarkar
5b71685dad feat(gateway): add Slack gateway configuration 2026-06-01 12:36:07 +05:30
Anish Sarkar
51bf2a8361 feat(gateway): wire WhatsApp bridge runtime 2026-05-29 10:20:25 +05:30
Anish Sarkar
3b529a3ab2 feat(gateway): add Baileys WhatsApp adapter 2026-05-29 10:19:13 +05:30
Anish Sarkar
3d9620275b feat(gateway): handle WhatsApp Cloud conversations 2026-05-29 10:18:45 +05:30
Anish Sarkar
daa123832e feat(gateway): add WhatsApp Cloud adapter 2026-05-29 10:18:28 +05:30
Anish Sarkar
a6b2882275 feat(gateway): add WhatsApp gateway configuration 2026-05-29 10:18:11 +05:30
Anish Sarkar
5048b0fd7c refactor(gateway): route inbound events through platform bundles 2026-05-29 10:17:57 +05:30
Anish Sarkar
e953be5e99 refactor(gateway): abstract platform command handling 2026-05-29 10:17:41 +05:30
Anish Sarkar
f6eb955676 refactor(gateway): share outbound text splitting 2026-05-29 10:17:28 +05:30
Anish Sarkar
3faaa25af6 refactor(database): update default source values to 'surfsense' for chat threads and messages 2026-05-28 13:11:05 +05:30
Anish Sarkar
c958fe5bc6 feat(gateway): introduce GATEWAY_TELEGRAM_INTAKE_MODE for Telegram integration 2026-05-28 05:02:07 +05:30
Anish Sarkar
afcadfb4bf fix(gateway): preserve request context during inbox processing 2026-05-28 04:38:20 +05:30
Anish Sarkar
08bf3cc023 refactor(gateway): run inbox and BYO polling from FastAPI lifespan 2026-05-28 04:38:00 +05:30
Anish Sarkar
a57b741d5e refactor(gateway): rename persistence models to external chat 2026-05-28 04:37:27 +05:30
Anish Sarkar
f2d82234d4 fix(gateway): ensure proper closure of event streams in agent invocation 2026-05-28 00:25:12 +05:30
Anish Sarkar
708e3a9120 feat(gateway): enhance logging and event handling in agent and Telegram translator 2026-05-28 00:07:37 +05:30
Anish Sarkar
bd86a72587 feat(gateway): add long-lived gateway runner 2026-05-27 23:39:05 +05:30
Anish Sarkar
b8538655bb feat(gateway): process inbound events through the agent 2026-05-27 23:38:52 +05:30
Anish Sarkar
967ec099c8 feat(gateway): add Telegram command and stream handling 2026-05-27 23:38:25 +05:30
Anish Sarkar
59e6475348 feat(gateway): add Telegram adapter and formatting 2026-05-27 23:38:09 +05:30
Anish Sarkar
c9b7d7b572 feat(gateway): add gateway domain primitives 2026-05-27 23:37:54 +05:30