Repository navigation
Closed
Description
Summary
When a workflow step carries an ask: guard and the user chooses Skip in the confirmation dialog, the step after the skipped one is skipped as well. Per the documented Choice Behavior, Skip must ignore only the current step and proceed to the next one.
Reproduction
hooks:
entries:
"*.mttl":
- action: run
command: "prepare.exe {{path}}"
ask: "Prepare the file?"
- action: run
command: "validate.exe {{path}}"
ask: "Validate before launch?"
- action: run
command: "log.exe {{filename}}"- Launch a matching file in the web UI.
- On step 1's confirmation choose Skip Step.
- Observe step 2.
Actual: step 2 is marked skipped with the note "Skipped by previous step" and validate.exe never runs; the workflow jumps to step 3.
Expected: only step 1 is skipped; step 2 asks its own confirmation ("Validate before launch?") and executes on Yes.
Documented behavior — Confirmation Guards (ask) → Choice Behavior: Skip — Ignores current step — Proceeds to next step.
Root cause
The "user skipped" decision is propagated as a one-shot flag that silently swallows the following step, in both engines:
- Core engine —
src/profiles/core/environment/workflow.py(run_workflow):skip_next = Trueafter a user skip (~line 232)- loop-top handler
if skip_next:(~lines 194–198) drops the next step
- Web session runner —
src/profiles/server/routes/workflow.py:session.skip_next = Truein thewaiting_ask/skipbranch (~line 434)_advance_sessionhandlerif session.skip_next:(~lines 151–156) marks the next recordskipped/ "Skipped by previous step"
Fix direction
- Remove the skip propagation in both engines: a
skipanswer marks only the answered stepskippedand advances to the next step normally. - Keep the documented last-step rule: skipping the final step ends the workflow without OS launch (SKIP_LAUNCH / "Skipped launch on final step.").
- Regression tests:
- core:
run_workflowwith steps[run+ask, run]anduser_choice="skip"must execute the second command. The existingtest_workflow_skip_step_overonly assertsoutcome == CONTINUE, so it passes whether or not the second step runs — strengthen it to assert the second command actually executed. - web runner: same scenario through
POST /api/workflow/{id}/respondwithaction: "skip".
- core:
- While touching the docs: the "Example with Multiple Guards" scenario table ("Yes → Skip → Yes: Step 2 skipped…") is confusing and can be clarified to match the fixed behavior.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Merge pull request #52 from falbany/fix/workflow-issues-20-21-23