Fix gt feed: filter empty bead IDs and deduplicate rapid updates

Two issues with the feed reported by user:
1. Empty entries showing "→  updated" with no bead ID
2. Same bead updated 8 times in 2 seconds (when adding multiple deps)

Fixes:
- Filter out update events with empty Target (bead ID)
- Deduplicate rapid updates to same bead within 2 second window

Root cause of empty IDs is in beads daemon (filed bd-sco6).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/joe
2025-12-30 21:13:54 -08:00
committed by Steve Yegge
parent ef7f15cfc5
commit 60ef12305c

View File

@@ -281,6 +281,11 @@ func (m *Model) addEvent(e Event) {
}
}
// Filter out events with empty bead IDs (malformed mutations)
if e.Type == "update" && e.Target == "" {
return
}
// Filter out noisy agent session updates from the event feed.
// Agent session molecules (like gt-gastown-crew-joe) update frequently
// for status tracking. These updates are visible in the agent tree,
@@ -293,6 +298,18 @@ func (m *Model) addEvent(e Event) {
return
}
// Deduplicate rapid updates to the same bead within 2 seconds.
// This prevents spam when multiple deps/labels are added to one issue.
if e.Type == "update" && e.Target != "" && len(m.events) > 0 {
lastEvent := m.events[len(m.events)-1]
if lastEvent.Type == "update" && lastEvent.Target == e.Target {
// Same bead updated within 2 seconds - skip duplicate
if e.Time.Sub(lastEvent.Time) < 2*time.Second {
return
}
}
}
// Add to event feed
m.events = append(m.events, e)