File tree Expand file tree Collapse file tree
ai/mcp/server/github-workflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1088,6 +1088,30 @@ components:
10881088 type : array
10891089 items :
10901090 type : string
1091+ notificationPreview :
1092+ type : object
1093+ description : A passive inbox preview of unread GitHub notifications. Present only if authenticated.
1094+ properties :
1095+ unreadCount :
1096+ type : integer
1097+ description : Total number of unread notifications.
1098+ example : 3
1099+ latest :
1100+ type : array
1101+ description : The 5 most recent unread notifications.
1102+ items :
1103+ type : object
1104+ properties :
1105+ id :
1106+ type : string
1107+ reason :
1108+ type : string
1109+ type :
1110+ type : string
1111+ title :
1112+ type : string
1113+ url :
1114+ type : string
10911115
10921116 Label :
10931117 type : object
Original file line number Diff line number Diff line change @@ -361,6 +361,27 @@ class HealthService extends Base {
361361 payload . status = 'unhealthy' ;
362362 payload . githubCli . details . push ( authCheck . error ) ;
363363 logger . info ( '[HealthService] gh-status: unauthenticated' ) ;
364+ } else {
365+ // Step 3: Enrich with Notifications (Passive Inbox) if authenticated
366+ try {
367+ const { stdout } = await execAsync ( 'gh api notifications' ) ;
368+ const notifications = JSON . parse ( stdout ) ;
369+ const mentions = notifications . filter ( n => n . reason === 'mention' ) ;
370+
371+ payload . notificationPreview = {
372+ unreadCount : mentions . length ,
373+ latest : mentions . slice ( 0 , 5 ) . map ( n => ( {
374+ id : n . id ,
375+ reason : n . reason ,
376+ type : n . subject ?. type ,
377+ title : n . subject ?. title ,
378+ url : n . subject ?. url
379+ } ) )
380+ } ;
381+ } catch ( e ) {
382+ logger . warn ( `[HealthService] Failed to fetch notifications for preview: ${ e . message } ` ) ;
383+ // Don't fail the healthcheck if notifications fail, just omit the preview
384+ }
364385 }
365386
366387 // If we made it here with no issues, everything is healthy
You can’t perform that action at this time.
0 commit comments