fix(ui): always render transcript message for non-succeeded runs

Use createHistoricalTranscriptMessage for failed/cancelled/timed_out
runs even before transcript data loads. This prevents the flash where
a plain "run X failed" status line transforms into a foldable "failed
after X minutes" header when transcripts arrive asynchronously.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-04-08 08:27:14 -05:00
parent 2cf2a44d68
commit ede3206423
+5 -2
View File
@@ -679,7 +679,10 @@ export function buildIssueChatMessages(args: {
for (const run of [...linkedRuns].sort((a, b) => toTimestamp(runTimestamp(a)) - toTimestamp(runTimestamp(b)))) {
const transcript = transcriptsByRunId?.get(run.runId) ?? [];
const hasRunOutput = transcript.length > 0 || (hasOutputForRun?.(run.runId) ?? false);
if (hasRunOutput) {
if (hasRunOutput || run.status !== "succeeded") {
// Always use the transcript message for non-succeeded runs (even before
// transcript data loads) so the message type and fold header are stable
// from initial render — avoids a flash when transcripts arrive later.
orderedMessages.push({
createdAtMs: toTimestamp(run.startedAt ?? run.createdAt),
order: 2,
@@ -692,7 +695,7 @@ export function buildIssueChatMessages(args: {
});
continue;
}
if (run.status === "succeeded" && !includeSucceededRunsWithoutOutput) continue;
if (!includeSucceededRunsWithoutOutput) continue;
orderedMessages.push({
createdAtMs: toTimestamp(runTimestamp(run)),
order: 2,