@@ -10,6 +10,7 @@ import {
1010 ClosedEvent ,
1111 CommentEvent ,
1212 CommitEvent ,
13+ CopilotFinishedErrorEvent ,
1314 CopilotFinishedEvent ,
1415 CopilotStartedEvent ,
1516 CrossReferencedEvent ,
@@ -27,7 +28,7 @@ import { ReviewType } from '../../src/github/views';
2728import PullRequestContext from '../common/context' ;
2829import { CommentView } from './comment' ;
2930import Diff from './diff' ;
30- import { commitIcon , mergeIcon , plusIcon , tasklistIcon , threeBars } from './icon' ;
31+ import { commitIcon , errorIcon , mergeIcon , plusIcon , tasklistIcon , threeBars } from './icon' ;
3132import { nbsp } from './space' ;
3233import { Timestamp } from './timestamp' ;
3334import { AuthorLink , Avatar } from './user' ;
@@ -95,6 +96,8 @@ export const Timeline = ({ events, isIssue }: { events: TimelineEvent[], isIssue
9596 return < CopilotStartedEventView key = { `copilotStarted${ event . id } ` } { ...event } /> ;
9697 case EventType . CopilotFinished :
9798 return < CopilotFinishedEventView key = { `copilotFinished${ event . id } ` } { ...event } /> ;
99+ case EventType . CopilotFinishedError :
100+ return < CopilotFinishedErrorEventView key = { `copilotFinishedError${ event . id } ` } { ...event } /> ;
98101 default :
99102 throw new UnreachableCaseError ( event ) ;
100103 }
@@ -466,4 +469,23 @@ const CopilotFinishedEventView = (event: CopilotFinishedEvent) => {
466469 < Timestamp date = { createdAt } />
467470 </ div >
468471 ) ;
472+ } ;
473+
474+ const CopilotFinishedErrorEventView = ( event : CopilotFinishedErrorEvent ) => {
475+ const { createdAt, onBehalfOf } = event ;
476+ return (
477+ < div className = "comment-container commit" >
478+ < div className = 'timeline-with-detail' >
479+ < div className = 'commit-message' >
480+ { errorIcon }
481+ { nbsp }
482+ < div className = "message" > Copilot stopped work on behalf of < AuthorLink for = { onBehalfOf } /> due to an error</ div >
483+ </ div >
484+ < div className = "commit-message-detail" >
485+ < a href = { event . sessionUrl } > Copilot has encountered an error. See logs for additional details.</ a >
486+ </ div >
487+ </ div >
488+ < Timestamp date = { createdAt } />
489+ </ div >
490+ ) ;
469491} ;
0 commit comments