mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-19 04:00:38 +09:00
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:
parent
2cf2a44d68
commit
ede3206423
1 changed files with 5 additions and 2 deletions
|
|
@ -679,7 +679,10 @@ export function buildIssueChatMessages(args: {
|
||||||
for (const run of [...linkedRuns].sort((a, b) => toTimestamp(runTimestamp(a)) - toTimestamp(runTimestamp(b)))) {
|
for (const run of [...linkedRuns].sort((a, b) => toTimestamp(runTimestamp(a)) - toTimestamp(runTimestamp(b)))) {
|
||||||
const transcript = transcriptsByRunId?.get(run.runId) ?? [];
|
const transcript = transcriptsByRunId?.get(run.runId) ?? [];
|
||||||
const hasRunOutput = transcript.length > 0 || (hasOutputForRun?.(run.runId) ?? false);
|
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({
|
orderedMessages.push({
|
||||||
createdAtMs: toTimestamp(run.startedAt ?? run.createdAt),
|
createdAtMs: toTimestamp(run.startedAt ?? run.createdAt),
|
||||||
order: 2,
|
order: 2,
|
||||||
|
|
@ -692,7 +695,7 @@ export function buildIssueChatMessages(args: {
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (run.status === "succeeded" && !includeSucceededRunsWithoutOutput) continue;
|
if (!includeSucceededRunsWithoutOutput) continue;
|
||||||
orderedMessages.push({
|
orderedMessages.push({
|
||||||
createdAtMs: toTimestamp(runTimestamp(run)),
|
createdAtMs: toTimestamp(runTimestamp(run)),
|
||||||
order: 2,
|
order: 2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue