mirror of
https://github.com/github/spec-kit.git
synced 2026-07-07 14:39:00 +08:00
address review: skip copy-back on paused/failed iterations
Move the status check before the copy-back so that partial results from paused or failed nested steps (e.g., a gate awaiting input) do not overwrite the unprefixed key. This preserves correct resume behavior.
This commit is contained in:
@@ -695,18 +695,21 @@ class WorkflowEngine:
|
||||
iter_steps, context, state, registry,
|
||||
step_offset=-1,
|
||||
)
|
||||
# Copy namespaced results back to unprefixed
|
||||
# keys so loop conditions see updated values.
|
||||
for namespaced, orig in original_ids.items():
|
||||
if namespaced in context.steps:
|
||||
context.steps[orig] = context.steps[namespaced]
|
||||
state.step_results[orig] = context.steps[namespaced]
|
||||
if state.status in (
|
||||
RunStatus.PAUSED,
|
||||
RunStatus.FAILED,
|
||||
RunStatus.ABORTED,
|
||||
):
|
||||
return
|
||||
# Copy namespaced results back to unprefixed
|
||||
# keys so loop conditions see updated values.
|
||||
# Only after a fully completed iteration —
|
||||
# partial results from paused/failed steps
|
||||
# must not overwrite the unprefixed key.
|
||||
for namespaced, orig in original_ids.items():
|
||||
if namespaced in context.steps:
|
||||
context.steps[orig] = context.steps[namespaced]
|
||||
state.step_results[orig] = context.steps[namespaced]
|
||||
|
||||
# Fan-out: execute nested step template per item with unique IDs
|
||||
if step_type == "fan-out":
|
||||
|
||||
Reference in New Issue
Block a user