Build generic chat adapter layer for multi-platform agent support

t-462·WorkTask·
·
·
·Omni/Agent/Chat.hs
Created3 months ago·Updated1 week ago·pipeline runs →

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 (32)

🔄[system]Open → InProgress2 months ago
💬[system]2 months ago

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

🔄[system]InProgress → Open2 months ago
🔄[system]Open → InProgress2 months ago
🔄[system]InProgress → Open2 months ago
💬[system]2 months ago

Pipeline: agent died without producing a commit, resetting

🔄[system]Open → InProgress2 months ago
🔄[human]InProgress → Open2 months ago
💬[human]2 months ago

Pipeline scheduler: failed to spawn agentd run

🔄[system]Open → InProgress2 months ago
🔄[human]InProgress → Open2 months ago
💬[human]2 months ago

Pipeline scheduler: failed to spawn agentd run

🔄[system]Open → InProgress2 months ago
💬[human]2 months ago

Pipeline scheduler: started run=pipeline-omni-agent-chat-hs-t-462-1771554730 domain=Omni/Agent/Chat.hs

🔄[human]InProgress → Open2 months ago
💬[human]2 months ago

Pipeline scheduler reset stale run pipeline-omni-agent-chat-hs-t-462-1771554730 (agentd reported running but no active container). Returning task to Open for requeue.

🔄[system]Open → InProgress2 months ago
💬[human]2 months ago

Pipeline scheduler: started run=pipeline-omni-agent-chat-hs-t-462-1771559948 domain=Omni/Agent/Chat.hs

🔄[human]InProgress → Review2 months ago
💬[human]2 months ago

Pipeline scheduler: run=pipeline-omni-agent-chat-hs-t-462-1771559948 domain=Omni/Agent/Chat.hs status=done cost=30c (fund-spend=failed)

💬[human]1 week ago

Ava triage: pipeline auto-run reached status=done but the agent made NO git commits and reported blockers (missing files, path mismatches, or need clarification). This task is not actually in review — there's nothing to review. Resetting status to Open so it can be re-scoped.

🔄[human]Review → Open1 week ago
🔄[human]Open → Verified1 week ago