@@ -36,7 +36,6 @@ func New(token, claudeKey, claudeModel string, dryRun bool, skillsDir string) *H
3636 }
3737}
3838
39- // ClassifyResult holds the classification outputs for use by callers.
4039type ClassifyResult struct {
4140 Detected bool
4241 SkillName string
@@ -70,7 +69,7 @@ func (h *Handler) HandleGithubEvent(githubEventName, githubEventPath string) (*C
7069
7170 reactor := ghcontext .NewReactor (h .token )
7271 if err := reactor .AddReaction (ctx , event .RepoOwner , event .RepoName , event .CommentID , event .IsReviewComment , "eyes" ); err != nil {
73- log .Printf ("Warning: failed to add eyes reaction: %v " , err )
72+ log .Printf ("failed to add eyes reaction: %s " , err )
7473 }
7574
7675 var promptParams classifier.PromptParams
@@ -85,12 +84,13 @@ func (h *Handler) HandleGithubEvent(githubEventName, githubEventPath string) (*C
8584 gh := ghcontext .New (h .token )
8685 prCtx , err := gh .FetchPRContext (ctx , event .RepoOwner , event .RepoName , event .PRNumber )
8786 if err != nil {
88- log .Printf ("Warning: failed to gather PR context: %v" , err )
87+ log .Printf ("failed to gather pr context: %v" , err )
8988 promptParams .PRTitle = "(unknown)"
9089 } else {
9190 promptParams .PRTitle = prCtx .PRTitle
9291 }
93- } else {
92+ }
93+ if event .IsIssueComment {
9494 gh := ghcontext .New (h .token )
9595 prCtx , err := gh .FetchPRContext (ctx , event .RepoOwner , event .RepoName , event .PRNumber )
9696 if err != nil {
@@ -101,17 +101,17 @@ func (h *Handler) HandleGithubEvent(githubEventName, githubEventPath string) (*C
101101 promptParams .ChangedFiles = ghcontext .FormatChangedFiles (prCtx .ChangedFiles )
102102 }
103103
104- cls := classifier .New (h .claudeKey , h .claudeModel )
105- result , err := cls .Classify (ctx , promptParams )
104+ claudeClassifier := classifier .New (h .claudeKey , h .claudeModel )
105+ result , err := claudeClassifier .Classify (ctx , promptParams )
106106 if err != nil {
107107 if reactErr := reactor .AddReaction (ctx , event .RepoOwner , event .RepoName , event .CommentID , event .IsReviewComment , "confused" ); reactErr != nil {
108- log .Printf ("Warning: failed to add confused reaction: %v" , reactErr )
108+ log .Printf ("failed to add confused reaction: %v" , reactErr )
109109 }
110110 return nil , fmt .Errorf ("classifying comment: %w" , err )
111111 }
112112
113113 if result .IsEmpty () {
114- log .Println ("Comment not a substantive learning, skipping" )
114+ log .Println ("comment not a substantive learning, skipping" )
115115 if err := setOutput ("detected" , "false" ); err != nil {
116116 return nil , err
117117 }
@@ -174,8 +174,6 @@ func (h *Handler) HandleGithubEvent(githubEventName, githubEventPath string) (*C
174174 }, nil
175175}
176176
177- // listExistingSkills scans dir for subdirectories containing a SKILL.md file
178- // and returns their directory names.
179177func listExistingSkills (dir string ) []string {
180178 if dir == "" {
181179 return nil
@@ -194,7 +192,6 @@ func listExistingSkills(dir string) []string {
194192 if relErr != nil {
195193 return nil
196194 }
197- // Only include top-level skill directories (not nested paths).
198195 if ! strings .Contains (rel , string (os .PathSeparator )) {
199196 skills = append (skills , rel )
200197 }
@@ -204,7 +201,6 @@ func listExistingSkills(dir string) []string {
204201 return skills
205202}
206203
207- // setOutput writes a key=value pair to the GITHUB_OUTPUT file.
208204func setOutput (key , value string ) error {
209205 outputFile := os .Getenv ("GITHUB_OUTPUT" )
210206 if outputFile == "" {
0 commit comments