Data Model: Slack Bot AG-UI Migration
Date: 2026-04-14 Spec: spec.md
Entitiesβ
SSEEvent (Updated)β
Represents a parsed AG-UI Server-Sent Event from the dynamic agents backend.
| Field | Type | Description |
|---|---|---|
type | SSEEventType (enum) | Event type (RUN_STARTED, TEXT_MESSAGE_CONTENT, etc.) |
delta | `str | None` |
message_id | `str | None` |
tool_call_id | `str | None` |
tool_call_name | `str | None` |
run_id | `str | None` |
thread_id | `str | None` |
outcome | `str | None` |
interrupt | `dict | None` |
message | `str | None` |
name | `str | None` |
value | `Any | None` |
steps | `list | None` |
snapshot | `dict | None` |
State transitions: None (SSEEvent is a value object, not stateful).
ChatRequest (Slack Bot Side)β
Request payload sent from the Slack bot to the dynamic agents backend.
| Field | Type | Required | Description |
|---|---|---|---|
message | str | Yes | User's message text |
conversation_id | str | Yes | UUID v5 derived from Slack thread_ts |
agent_id | str | Yes | Dynamic agent config ID from channel config |
trace_id | `str | None` | No |
ResumeRequestβ
Request payload for resuming after HITL interrupt.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | str | Yes | Same agent_id as the interrupted stream |
conversation_id | str | Yes | Same conversation_id as the interrupted stream |
form_data | str | Yes | JSON string of form field values, or rejection message |
trace_id | `str | None` | No |
ChannelConfig (Updated)β
Configuration for a Slack channel's bot behavior.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | str | Yes | β | Human-readable channel name |
ai_enabled | bool | No | True | Whether the bot responds in this channel |
agent_id | `str | None` | No | None (falls back to defaults.default_agent_id) |
custom_prompt | `str | None` | No | None |
qanda | QandaConfig | No | Default | Q&A mode configuration |
ai_alerts | AIAlertsConfig | No | Default | AI alert processing configuration |
other | OtherConfig | No | Default | Jira, escalation, delete admin config |
New in this migration: agent_id field.
GlobalDefaults (Updated)β
| Field | Type | Default | Description |
|---|---|---|---|
default_agent_id | `str | None` | None |
| (all existing fields) | β | β | response_style_instruction, prompts, etc. |
New in this migration: default_agent_id field.
HITLInterruptβ
Parsed HITL interrupt from AG-UI RUN_FINISHED event.
| Field | Type | Description |
|---|---|---|
interrupt_id | str | Unique identifier for this interrupt (from interrupt.id) |
reason | str | Always "human_input" |
prompt | str | Human-readable description of what input is needed |
fields | list[InterruptField] | Form field definitions |
agent | str | Name of the agent requesting input |
InterruptFieldβ
A single form field in a HITL interrupt.
| Field | Type | Description |
|---|---|---|
field_name | str | Machine-readable field identifier |
field_label | str | Human-readable label |
field_description | `str | None` |
field_type | str | One of: text, select, multiselect, boolean, number, url, email |
field_values | `list[str] | None` |
required | bool | Whether the field is required |
default_value | `str | None` |
placeholder | `str | None` |
ConversationId (Value Object)β
| Property | Value |
|---|---|
| Format | UUID v5 |
| Namespace | uuid5(NAMESPACE_URL, "slack.caipe.io") β constant |
| Name | Slack thread_ts string |
| Determinism | Same thread_ts always produces the same UUID |
SessionManager Caches (Simplified)β
| Cache | Key | Value | TTL |
|---|---|---|---|
_user_info_cache | user_id | Slack user info dict | 600s |
_skipped_cache | thread_ts | Skip reason string | 300s |
_escalated_threads | thread_ts | Boolean (set membership) | No TTL |
Removed caches: _context_cache (conversation IDs are now computed, not cached), _trace_cache (trace_id is conversation_id in AG-UI).
Relationshipsβ
ChannelConfig ββhasββ agent_id ββresolves toββ DynamicAgentConfig (backend)
SlackThread ββgeneratesββ ConversationId (UUID v5 from thread_ts)
ConversationId ββmaps toββ LangGraph thread_id (backend)
SSEClient ββsendsββ ChatRequest ββtoββ /api/v1/chat/stream/start
SSEClient ββreceivesββ SSEEvent stream
SSEEvent(RUN_FINISHED, interrupt) ββparsed asββ HITLInterrupt
HITLInterrupt ββrendered asββ Slack Block Kit form
FormSubmission ββsendsββ ResumeRequest ββtoββ /api/v1/chat/stream/resume