-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description
Two low-severity issues identified by cursor bot in PR #46 were deferred for follow-up work:
1. Empty assistant message appended on cancelled runs (Low Severity)
Location: pkg/plugin/plugin.go:623-630
Issue: consumeAgentEvents unconditionally appends an assistant message to the session after every run, even when the run was immediately cancelled and produced zero content events. reconstructAssistantMessage returns SessionMessage{Role: "assistant", Content: ""} in that case, which gets persisted. Repeated cancellations accumulate empty messages, inflating MessageCount and cluttering the session history.
Fix: Add a check before appending:
```go
assistantMsg := reconstructAssistantMessage(allEvents)
if assistantMsg.Content != "" || len(assistantMsg.ToolCalls) > 0 {
if err := p.sessionStore.AppendMessages(...); err != nil {
// handle error
}
}
```
Cursor Bot Comment: #46 (comment)
2. GetBroadcaster is unused dead code (Low Severity)
Locations:
pkg/plugin/runstore.go:36-37(interface)pkg/plugin/runstore.go:198-204(in-memory impl)pkg/plugin/runstore_redis.go:176-181(Redis impl)
Issue: GetBroadcaster is declared in RunStoreInterface and implemented on both RunStore and RedisRunStore, but it's never called anywhere in the codebase. The newly added SubscribeAndSnapshot method made it redundant. This is dead code that adds to the interface surface area without providing value.
Fix: Remove GetBroadcaster from:
RunStoreInterfacedeclarationRunStoreimplementationRedisRunStoreimplementation
Cursor Bot Comment: #46 (comment)
Priority
Low - These issues don't affect functionality, only code quality and session history cleanliness.