Summary
The specification documents a comprehensive message classification system for chat messages, but the current implementation only supports a subset of the required classifications.
Current State
The ChatMessage model currently has a human_interaction_type field that uses HITLRequestType enum with these values:
APPROVAL (approval)
INPUT (input)
REVIEW (review)
ESCALATION (escalation)
NOTIFICATION (notification)
Missing Classifications
According to SPECIFICATION.md (lines 858-877), the following classifications are missing:
Internal Messages
INTERNAL - Agent-only messages, hidden from human UI (LLM reasoning, tool calls, intermediate steps)
Chat Messages
CHAT - Normal human-AI conversation
CHAT_ASSISTANT - AI response in conversation
Response Messages
RESPONSE - Human's response to a pending request
Alert Messages
ALERT_INFO - System info alert
ALERT_WARNING - System warning alert
ALERT_ERROR - System error alert
ALERT_CRITICAL - System critical alert
Lifecycle States
TIMED_OUT - Request expired without response
CANCELLED - Request was cancelled
Value
Implementing the full classification system provides:
- Better UI Filtering - UIs can filter messages by type (e.g., hide INTERNAL messages, show only ALERT_* messages)
- Audit Trails - Clear separation between user-facing messages and internal agent operations
- Separation of Concerns - Distinguish between:
- Procedure internals (INTERNAL)
- Human-AI chat (CHAT/CHAT_ASSISTANT)
- Procedure notifications (NOTIFICATION)
- System monitoring (ALERT_*)
- Interactive requests (PENDING_*)
Implementation Notes
- Extend Enum or Create New: Decide whether to extend
HITLRequestType or create a new MessageClassification enum that encompasses all types
- Backwards Compatibility: The current
human_interaction_type field should continue to work, but may need to map to the broader classification system
- Message Creation: Update all places where
ChatMessage objects are created to set appropriate classifications:
- Agent reasoning/tool calls →
INTERNAL
- Normal conversation →
CHAT / CHAT_ASSISTANT
- Human responses →
RESPONSE
- System alerts →
ALERT_*
- UI Integration: Ensure the IDE and any UI components can filter/display messages based on classification
Related Documentation
- SPECIFICATION.md lines 858-886
- TECHNICAL_DEBT.md "HITL Message Classifications" section (Category 3)
- Current implementation:
tactus/protocols/models.py ChatMessage and HITLRequestType
Acceptance Criteria
Summary
The specification documents a comprehensive message classification system for chat messages, but the current implementation only supports a subset of the required classifications.
Current State
The
ChatMessagemodel currently has ahuman_interaction_typefield that usesHITLRequestTypeenum with these values:APPROVAL(approval)INPUT(input)REVIEW(review)ESCALATION(escalation)NOTIFICATION(notification)Missing Classifications
According to SPECIFICATION.md (lines 858-877), the following classifications are missing:
Internal Messages
INTERNAL- Agent-only messages, hidden from human UI (LLM reasoning, tool calls, intermediate steps)Chat Messages
CHAT- Normal human-AI conversationCHAT_ASSISTANT- AI response in conversationResponse Messages
RESPONSE- Human's response to a pending requestAlert Messages
ALERT_INFO- System info alertALERT_WARNING- System warning alertALERT_ERROR- System error alertALERT_CRITICAL- System critical alertLifecycle States
TIMED_OUT- Request expired without responseCANCELLED- Request was cancelledValue
Implementing the full classification system provides:
Implementation Notes
HITLRequestTypeor create a newMessageClassificationenum that encompasses all typeshuman_interaction_typefield should continue to work, but may need to map to the broader classification systemChatMessageobjects are created to set appropriate classifications:INTERNALCHAT/CHAT_ASSISTANTRESPONSEALERT_*Related Documentation
tactus/protocols/models.pyChatMessageandHITLRequestTypeAcceptance Criteria
human_interaction_typeusage