Files
goclaw/pkg/protocol/events.go
T
viettranxandClaude Opus 4.6 0e75c21e55 feat: overhaul team delegation, Telegram resilience, and artifact forwarding
Team delegation:
- Unify spawn/subagent/delegate into single spawn tool
- Sibling-aware announce suppression with artifact accumulation
- Fix auto-complete race (isLastDelegation guard)
- Add team tasks list limit (20) with search guidance
- Multi-round orchestration patterns in TEAM.md
- Communication guidance for initial vs follow-up delegations

Telegram resilience:
- Add retrySend wrapper (3 attempts, escalating delay) for network errors
- Fix HTML fallback: strip tags + unescape entities instead of showing raw HTML
- Pre-process HTML tags in LLM output to markdown before conversion pipeline
- Skip caption truncation entirely when > 1024 bytes, send text separately
- Auto-send large images (>5MB) as documents to avoid compression

Artifact forwarding:
- Fix missing ContentType on forwarded media (mimeFromExt for result.Media/ForwardMedia)
- Add deliver parameter to write_file for file attachment delivery
- Extend mimeFromExt with document MIME types

UI: fix regenerate dialog overflow, improve task list layout, delegation detail view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 14:34:36 +07:00

56 lines
1.8 KiB
Go

package protocol
// WebSocket event names pushed from server to client.
const (
EventAgent = "agent"
EventChat = "chat"
EventHealth = "health"
EventCron = "cron"
EventExecApprovalReq = "exec.approval.requested"
EventExecApprovalRes = "exec.approval.resolved"
EventPresence = "presence"
EventTick = "tick"
EventShutdown = "shutdown"
EventNodePairRequested = "node.pair.requested"
EventNodePairResolved = "node.pair.resolved"
EventDevicePairReq = "device.pair.requested"
EventDevicePairRes = "device.pair.resolved"
EventVoicewakeChanged = "voicewake.changed"
EventConnectChallenge = "connect.challenge"
EventHeartbeat = "heartbeat"
EventTalkMode = "talk.mode"
// Agent summoning events (predefined agent setup via LLM).
EventAgentSummoning = "agent.summoning"
// Agent handoff event (payload: from_agent, to_agent, reason).
EventHandoff = "handoff"
// Team activity events (real-time team workflow visibility).
EventTeamTaskCreated = "team.task.created"
EventTeamTaskCompleted = "team.task.completed"
EventTeamMessageSent = "team.message.sent"
EventDelegationStarted = "delegation.started"
EventDelegationCompleted = "delegation.completed"
// Cache invalidation events (internal, not forwarded to WS clients).
EventCacheInvalidate = "cache.invalidate"
)
// Agent event subtypes (in payload.type)
const (
AgentEventRunStarted = "run.started"
AgentEventRunCompleted = "run.completed"
AgentEventRunFailed = "run.failed"
AgentEventRunRetrying = "run.retrying"
AgentEventToolCall = "tool.call"
AgentEventToolResult = "tool.result"
)
// Chat event subtypes (in payload.type)
const (
ChatEventChunk = "chunk"
ChatEventMessage = "message"
ChatEventThinking = "thinking"
)