Skip to content

Workflow hooks: notify + ask runs two sequential prompts — the "Continue Workflow" gate appears after the confirmation #22

Closed

Description

@falbany

Summary

Combining action: notify with an ask: guard produces two sequential interactive gates for a single step. After answering the Yes/Skip/No confirmation, the workflow does not move on: the same step re-renders as a notification with a Continue Workflow button, displayed after the confirmation dialog.

Reproduction

hooks:
  entries:
    "*.mttl":
      - action: notify
        message: "# Ready to launch"
        ask: "Proceed with the launch?"
        wait: true
      - action: run
        command: "post_launch.exe {{filename}}"
  1. Launch a matching file in the web UI.
  2. The modal shows the step's message with Confirmation Prompt: "Proceed with the launch?" and the buttons Abort / Skip / Execute.
  3. Click Execute Step.

Actual: the modal stays on the same step and now shows Notification Message (the same message, rendered a second time) with a Continue Workflow button — a second manual confirmation after the ask dialog, before the workflow advances to the next step.

Expected: a single interaction. The ask dialog already composes the step's Markdown message above the question (exactly what the docs describe for message + ask, see Message Display Rules). Answering Yes should complete the notify step and advance to the next step. Skip / No semantics are unchanged.

Root cause

  • Web session runner — src/profiles/server/routes/workflow.py (_advance_session):
    1. The ask branch fires for any step carrying ask (~line 161) → session enters waiting_ask.
    2. After a yes answer, the notify branch (step.action == "notify" and session.notify_message is None, ~line 203) pauses the same step again in waiting_notify.
    • Fix: when the step whose ask was just answered is a notify, mark the record completed and advance instead of entering waiting_notify.
  • Core engine — src/profiles/core/environment/workflow.py (run_workflow → _execute_step): _resolve_ask_choice already displayed the composed message + question dialog, then the notify branch calls show_notify_dialog(message, blocking=step.wait) (~line 488) → the same double display exists in the native GUI (blocking when wait: true).

Fix direction

Decide the canonical rule in the core engine and mirror it in the web runner:

When a notify step carries an ask: guard, the composed ask dialog is the notification display; answering Yes completes the step (no second blocking notify dialog / waiting_notify pause).

Add regression tests for both backends (notify + ask + wait: true → exactly one prompt; Yes → step completed, workflow advanced).

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added this to the v1.0.0 milestone on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions