From 42341fc740923442d14349bb65fe6075bd50cd35 Mon Sep 17 00:00:00 2001 From: "Do-hyun Ko (Dori)" Date: Thu, 14 May 2026 13:51:23 +0900 Subject: [PATCH 1/2] feat: include comment body in PR/issue comment notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 100 rune 길이 제한으로 잘라서 두 번째 블록으로 첨부. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/event/callback/issue.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/internal/event/callback/issue.go b/internal/event/callback/issue.go index 45e4caa..334d923 100644 --- a/internal/event/callback/issue.go +++ b/internal/event/callback/issue.go @@ -18,8 +18,17 @@ const ( issueOpenedTitle = ":rotating_light: %s New issue opened! %s by %s" issueAssignedTitleFormat = ":pray: %s assigned to %s" issueClosedTitleFormat = ":x: %s closed by %s" + commentBodyMaxRunes = 100 ) +func truncateRunes(s string, max int) string { + runes := []rune(s) + if len(runes) <= max { + return s + } + return string(runes[:max]) + "..." +} + func NewIssueCommentCreated(commonSvc *svc.CommonSvc, issueSvc *svc.IssueSvc) *IssueCommentCreated { return &IssueCommentCreated{ commonSvc: commonSvc, @@ -85,9 +94,11 @@ func (cb *IssueCommentCreated) buildMessage(ctx context.Context, installCtx gith title = fmt.Sprintf(issueCommentCreatedTitleFormat, mentionTexts.String(), model.InlineLink(event.Issue.GetHTMLURL(), "issue"), sender) } - return model.NewMessage( - model.NewTextBlock(title), - ), nil + blocks := []model.MessageBlock{model.NewTextBlock(title)} + if body := truncateRunes(event.Comment.GetBody(), commentBodyMaxRunes); body != "" { + blocks = append(blocks, model.NewTextBlock(body)) + } + return model.NewMessage(blocks...), nil } func NewIssuesEventOpened(commonSvc *svc.CommonSvc, issueSvc *svc.IssueSvc) *IssuesEventOpened { From fa6e95a6ebb40085e9e25f6d4d50963eceda5809 Mon Sep 17 00:00:00 2001 From: "Do-hyun Ko (Dori)" Date: Thu, 14 May 2026 14:10:28 +0900 Subject: [PATCH 2/2] fix: escape special chars in comment body to avoid ANTLR tag conflicts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ChannelTalk 메시지 포맷이 , 등 ANTLR 태그를 인식하기 때문에, 코멘트에 우연히 포함된 <, >, &, " 가 raw로 들어가면 파싱이 깨질 수 있어 EscapedString 으로 한 번 거쳐서 전달. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/event/callback/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/event/callback/issue.go b/internal/event/callback/issue.go index 334d923..2dc68d0 100644 --- a/internal/event/callback/issue.go +++ b/internal/event/callback/issue.go @@ -96,7 +96,7 @@ func (cb *IssueCommentCreated) buildMessage(ctx context.Context, installCtx gith blocks := []model.MessageBlock{model.NewTextBlock(title)} if body := truncateRunes(event.Comment.GetBody(), commentBodyMaxRunes); body != "" { - blocks = append(blocks, model.NewTextBlock(body)) + blocks = append(blocks, model.NewTextBlock(model.EscapedString(body))) } return model.NewMessage(blocks...), nil }