feat(channels): real-time agent activity status & intent classification

- Add tool status display on channels during tool execution (streaming preview + reactions)
- Emit agent.activity events at phase transitions (thinking, tool_exec, compacting)
- Enrich delegation progress with per-member activity and tool info
- Add LLM-based intent classifier for DM status queries when agent is busy
  - Keyword fast-path for cancel/status patterns (no LLM cost)
  - Falls back to LLM classification with 5s timeout
  - Supports status_query (immediate reply) and cancel (abort run) intents
- Register/unregister runs in makeSchedulerRunFunc for channel inbound tracking
- Add sessionRuns secondary index in Router for O(1) IsSessionBusy lookups
- Add intent_classify config toggle (global default + per-agent override)
- Add tool_status config toggle for channel tool status display
- Add i18n keys and translations (en/vi/zh) for status messages
- Add web UI config toggles for intent_classify and tool_status
This commit is contained in:
viettranx committed 2026-03-09 23:58:56 +07:00
1 parent e63ff014cb
commit e593b9cf22
24 files changed
+593 -11

No files matched your search

+1
View File
@@ -76,6 +76,7 @@ const (
AgentEventToolCall = "tool.call"
AgentEventToolResult = "tool.result"
AgentEventBlockReply = "block.reply"
AgentEventActivity = "activity" // agent phase transitions: thinking, tool_exec, compacting
)
// Chat event subtypes (in payload.type)
+2
View File
@@ -30,6 +30,8 @@ type DelegationProgressItem struct {
TargetDisplayName string `json:"target_display_name,omitempty"`
ElapsedMS int `json:"elapsed_ms"`
TeamTaskID string `json:"team_task_id,omitempty"`
Activity string `json:"activity,omitempty"` // "thinking", "tool_exec", "compacting"
Tool string `json:"tool,omitempty"` // current tool name (when Activity == "tool_exec")
}
// DelegationProgressPayload is emitted periodically for async delegations.