runner: keep export handoffs nonterminal through recovery
This commit is contained in:
@@ -183,6 +183,7 @@ function runStateFields(current) {
|
||||
executing: Boolean(current.executing),
|
||||
cancel_requested: Boolean(current.cancel_requested),
|
||||
cleanup_unconfirmed: Boolean(current.cleanup_unconfirmed),
|
||||
export_pending_sequence: Number(current.export_pending_sequence) || 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -206,6 +207,9 @@ function applyRunStateFields(current, frame) {
|
||||
? (frame.resource_wait ?? null)
|
||||
: before.resource_wait,
|
||||
status,
|
||||
...(before.export_pending_sequence || Number(frame.export_pending_sequence) > 0 || Object.hasOwn(current, "export_pending_sequence")
|
||||
? { export_pending_sequence: blank(frame.status) ? before.export_pending_sequence : status === "waiting" ? Number(frame.export_pending_sequence) || 0 : 0 }
|
||||
: {}),
|
||||
outcome: blank(frame.outcome) ? before.outcome : frame.outcome,
|
||||
current_stage: blank(frame.current_stage) ? before.current_stage : frame.current_stage,
|
||||
completed_steps: Math.max(before.completed_steps, Number(frame.completed_steps) || 0),
|
||||
@@ -230,7 +234,8 @@ function applyRunStateFields(current, frame) {
|
||||
merged.executing !== before.executing ||
|
||||
merged.cancel_requested !== before.cancel_requested ||
|
||||
merged.cleanup_unconfirmed !== before.cleanup_unconfirmed;
|
||||
return changed ? { ...current, ...merged, ...(graphEvidence ? { graph_evidence: graphEvidence } : {}) } : current;
|
||||
const exportWaitChanged = (Number(merged.export_pending_sequence) || 0) !== before.export_pending_sequence;
|
||||
return changed || exportWaitChanged ? { ...current, ...merged, ...(graphEvidence ? { graph_evidence: graphEvidence } : {}) } : current;
|
||||
}
|
||||
|
||||
// Reuse the detail's monotonic visit merge, then compact by last stage visit and
|
||||
@@ -280,6 +285,7 @@ export function newRunSummaryFromFrame(frame) {
|
||||
title: blank(frame.title) ? null : frame.title,
|
||||
version: Number(frame.version) || 0,
|
||||
status: frame.status ?? "",
|
||||
...(Number(frame.export_pending_sequence) > 0 ? { export_pending_sequence: Number(frame.export_pending_sequence) } : {}),
|
||||
executing: executingFor(frame.status, true),
|
||||
cancel_requested: frame.cancel_requested === true,
|
||||
cleanup_unconfirmed: frame.cleanup_unconfirmed === true,
|
||||
|
||||
Reference in New Issue
Block a user