You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Add status_set tool for agent activity indicators (#462)
## Overview
Implements a `status_set` tool that allows AI agents to display their
current activity with an emoji and message. The status appears in the UI
next to the streaming indicator.
## Implementation
**Tool Specification:**
- Accepts `{emoji: string, message: string}`
- Emoji: Single emoji character, validated with Unicode properties
(`\p{Emoji_Presentation}\p{Extended_Pictographic}`)
- Message: Max 40 characters
- Status persists after stream completion (unlike todos which are
stream-scoped)
**Visual Behavior:**
- Shows emoji next to streaming dot indicator
- Streaming: Full color emoji, message on hover
- Idle: Greyscale emoji (60% opacity), message on hover
- Appears in both WorkspaceHeader (main chat) and WorkspaceListItem
(sidebar)
**Architecture:**
- Tool returns success, frontend tracks status via
`StreamingMessageAggregator`
- Uses `undefined` instead of `null` for optional types (more idiomatic
TypeScript)
- Component refactoring: Extracted `WorkspaceHeader`, renamed
`StatusIndicator` → `AgentStatusIndicator`
- Deduplicated tooltip logic via shared `statusTooltip` utility
- Component uses `useWorkspaceSidebarState(workspaceId)` internally -
minimal props
**Emoji Validation:**
```typescript
schema: z.object({
emoji: z.string()
.regex(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]$/u)
.refine((val) => [...val].length === 1, { message: "Must be exactly one emoji" }),
message: z.string().max(40),
})
```
Handles multi-byte emojis correctly using spread operator to count
actual characters (not UTF-16 code units).
## Tests
**Schema Validation (8 tests):**
- Emoji validation: Accepts single emojis, rejects
multiple/text/empty/mixed
- Message validation: Length limits, empty messages
**Aggregator Integration (5 tests):**
- Status tracking through tool calls
- Persistence after stream completion
- Failed tool calls don't update status
All tests passing ✅
_Generated with `cmux`_
0 commit comments