From 1ec6df9eb5fb1bd6601355e447ad9877ba1919f6 Mon Sep 17 00:00:00 2001 From: beads/crew/fang Date: Tue, 30 Dec 2025 21:21:37 -0800 Subject: [PATCH] fix: emit issue title with dep/label/comment mutation events (bd-sco6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added lookupIssueMeta helper to fetch title and assignee before emitting mutation events. This makes bd activity and gt feed show informative entries like "gt-xxx updated · Title..." instead of just "gt-xxx updated". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/rpc/server_labels_deps_comments.go | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/internal/rpc/server_labels_deps_comments.go b/internal/rpc/server_labels_deps_comments.go index d7973701..f9e65142 100644 --- a/internal/rpc/server_labels_deps_comments.go +++ b/internal/rpc/server_labels_deps_comments.go @@ -10,6 +10,19 @@ import ( "github.com/steveyegge/beads/internal/types" ) +// lookupIssueMeta fetches title and assignee for mutation events. +// Returns empty strings on error (acceptable for non-critical mutation metadata). +func (s *Server) lookupIssueMeta(ctx context.Context, issueID string) (title, assignee string) { + if s.storage == nil { + return "", "" + } + issue, err := s.storage.GetIssue(ctx, issueID) + if err != nil || issue == nil { + return "", "" + } + return issue.Title, issue.Assignee +} + // isChildOf returns true if childID is a hierarchical child of parentID. // For example, "bd-abc.1" is a child of "bd-abc", and "bd-abc.1.2" is a child of "bd-abc.1". func isChildOf(childID, parentID string) bool { @@ -64,8 +77,8 @@ func (s *Server) handleDepAdd(req *Request) Response { } // Emit mutation event for event-driven daemon - // Title/assignee empty for dependency operations (would require extra lookup) - s.emitMutation(MutationUpdate, depArgs.FromID, "", "") + title, assignee := s.lookupIssueMeta(ctx, depArgs.FromID) + s.emitMutation(MutationUpdate, depArgs.FromID, title, assignee) return Response{Success: true} } @@ -97,8 +110,8 @@ func (s *Server) handleSimpleStoreOp(req *Request, argsPtr interface{}, argDesc } // Emit mutation event for event-driven daemon - // Title/assignee empty for simple store operations (would require extra lookup) - s.emitMutation(MutationUpdate, issueID, "", "") + title, assignee := s.lookupIssueMeta(ctx, issueID) + s.emitMutation(MutationUpdate, issueID, title, assignee) return Response{Success: true} } @@ -172,8 +185,8 @@ func (s *Server) handleCommentAdd(req *Request) Response { } // Emit mutation event for event-driven daemon - // Title/assignee empty for comment operations (would require extra lookup) - s.emitMutation(MutationComment, commentArgs.ID, "", "") + title, assignee := s.lookupIssueMeta(ctx, commentArgs.ID) + s.emitMutation(MutationComment, commentArgs.ID, title, assignee) data, _ := json.Marshal(comment) return Response{