[codex] Add runtime lifecycle recovery and live issue visibility (#4419)

This commit is contained in:
Dotta 2026-04-24 15:50:32 -05:00 committed by GitHub
parent 9a8d219949
commit 5a0c1979cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
121 changed files with 9625 additions and 2044 deletions

View file

@ -18,6 +18,8 @@ export interface IssueTimelineEvent {
from: IssueTimelineAssignee;
to: IssueTimelineAssignee;
};
commentId?: string | null;
followUpRequested?: boolean;
}
function asRecord(value: unknown): Record<string, unknown> | null {
@ -53,11 +55,26 @@ export function extractIssueTimelineEvents(activity: ActivityEvent[] | null | un
const events: IssueTimelineEvent[] = [];
for (const event of activity ?? []) {
if (event.action !== "issue.updated") continue;
const details = asRecord(event.details);
if (!details) continue;
if (event.action === "issue.comment_added") {
if (details.followUpRequested !== true && details.resumeIntent !== true) continue;
if (details.reopened === true) continue;
const commentId = nullableString(details.commentId);
events.push({
id: event.id,
createdAt: event.createdAt,
actorType: event.actorType,
actorId: event.actorId,
commentId,
followUpRequested: true,
});
continue;
}
if (event.action !== "issue.updated") continue;
const previous = asRecord(details._previous);
const timelineEvent: IssueTimelineEvent = {
id: event.id,
@ -65,6 +82,10 @@ export function extractIssueTimelineEvents(activity: ActivityEvent[] | null | un
actorType: event.actorType,
actorId: event.actorId,
};
if (details.followUpRequested === true || details.resumeIntent === true) {
timelineEvent.followUpRequested = true;
timelineEvent.commentId = nullableString(details.commentId);
}
if (hasOwn(details, "status")) {
const from = nullableString(previous?.status) ?? nullableString(details.reopenedFrom);
@ -96,7 +117,7 @@ export function extractIssueTimelineEvents(activity: ActivityEvent[] | null | un
}
}
if (timelineEvent.statusChange || timelineEvent.assigneeChange) {
if (timelineEvent.statusChange || timelineEvent.assigneeChange || timelineEvent.followUpRequested) {
events.push(timelineEvent);
}
}