Build generic chat adapter layer for multi-platform agent support

t-462·WorkTask·
·
·
·Omni/Agent/Chat.hs
Created1 month ago·Updated1 hour ago

Description

Edit

Create a platform-agnostic chat interface abstraction that allows the agent system to work with multiple chat platforms (Telegram, Zulip, Slack, etc.) without duplicating core logic.

Current Architecture

  • Omni/Agent.hs - core agent engine (platform-agnostic)
  • Omni/Ava.hs - telegram-specific wrapper
  • Skills system is already generic and composable

Proposed Architecture

Omni.Agent (core)
  ├─ skills system
  ├─ tool registry  
  └─ provider interface

Omni.Agent.Chat (NEW - generic adapter)
  ├─ input: platform-agnostic message type
  ├─ output: platform-agnostic response type
  └─ handles: conversation state, skill loading, tool execution

Omni.Agent.Chat.Telegram
  └─ maps telegram api ↔ generic chat types

Omni.Agent.Chat.Zulip
  └─ maps zulip api ↔ generic chat types

Omni.Agent.Chat.Slack
  └─ maps slack api ↔ generic chat types

Minimal Shared Types

data ChatMessage = ChatMessage
  { sender :: UserId
  , text :: Text
  , attachments :: [Attachment]
  , thread :: Maybe ThreadId
  }

data ChatResponse = ChatResponse
  { text :: Text
  , formatting :: MarkupType  -- markdown, html, plain
  , actions :: [Action]  -- buttons, edits, etc
  }

Implementation Notes

  • Keep abstraction THIN - just enough to route messages
  • Don't try to unify every platform feature
  • Platform-specific features (telegram polls, slack workflows) stay in adapters
  • Extract and generalize existing Ava/Telegram logic
  • Maintain the unixy composability that makes the skill system work well

Timeline (4)

🔄[system]Open → InProgress2 hours ago
💬[system]1 hour ago

Pipeline: dev failed (run=dev-t-462-1771468859): Agent exited with code -15:

🔄[system]InProgress → Open1 hour ago