Skip to content

The agent that grows with you

fix(desktop): show group member failure reasons

Jony7d33bc00f9c5
diff --git a/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts b/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
index c3734144c6c..647eb93af72 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-activity.test.ts
@@ -28,9 +28,8 @@ const MEMBERS: GroupMember[] = [
{ name: 'ops', title: 'The Ops' }
]
-/** A failed turn's activity row carries the typed reason the gateway sent.
- * `recordGroupActivity` spreads it through, so it isn't on the entry type. */
-type ActivityRow = GroupActivityEntry & { reason?: string }
+/** A failed turn's activity row carries the typed reason the gateway sent. */
+type ActivityRow = GroupActivityEntry
interface Room {
activity: typeof groupActivity
@@ -273,6 +272,9 @@ describe('feed shape', () => {
expect(label({ kind: 'queued', member: 'You' })).toBe('You sent a message')
expect(label({ kind: 'replied', member: 'research' })).toBe('research replied')
expect(label({ kind: 'timed-out', member: 'ops' })).toBe('ops took too long')
+ expect(label({ kind: 'failed', member: 'ops', reason: 'slot wait timed out' })).toBe(
+ 'ops hit an error — slot wait timed out'
+ )
expect(label({ kind: 'cancelled', member: null })).toBe('turn interrupted by a newer message')
expect(label({ kind: 'settled', member: null })).toBe('turn settled')
})
diff --git a/apps/desktop/src/plugins/hermes-bots/group-activity.ts b/apps/desktop/src/plugins/hermes-bots/group-activity.ts
index ef93fa4218a..067b8197160 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-activity.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-activity.ts
@@ -81,8 +81,9 @@ export function groupActivityLabel(event: GroupActivityEntry, group?: null | str
}
const who = event?.member === 'You' ? 'You' : groupSpeakerLabel(event?.member || 'A bot', group)
+ const reason = kind === 'failed' ? String(event?.reason || '').trim() : ''
- return `${who} ${base}`
+ return `${who} ${base}${reason ? ` — ${reason}` : ''}`
}
const GROUP_ACTIVITY_LABELS: Record<GroupActivityKind, string> = {
diff --git a/apps/desktop/src/plugins/hermes-bots/types.ts b/apps/desktop/src/plugins/hermes-bots/types.ts
index 7db8cfc2530..4a889f127b2 100644
--- a/apps/desktop/src/plugins/hermes-bots/types.ts
+++ b/apps/desktop/src/plugins/hermes-bots/types.ts
@@ -276,6 +276,7 @@ export interface GroupActivityEvent {
kind: GroupActivityKind
member?: string
preview?: string
+ reason?: string
}
/**