Repository navigation
Fix workflow skip propagation, {{output}} in web prompts, and message ordering (#20, #21, #23) - #52
Merged
Merged
Conversation
… in web prompts (#21, #23) - Remove the skip_next propagation in both engines: choosing Skip on an ask guard now marks only the answered step skipped and advances to the next step, which still runs (and asks its own guard). The documented last-step rule (skip final step -> SKIP_LAUNCH, no OS launch) is kept. - Feed session.last_output into the web session runner's ask / notice / notify text substitutions so {{output}} resolves like in the native engine (it previously resolved to an empty string). - Clarify the "Example with Multiple Guards" scenario table in both hooks guides; strengthen test_workflow_skip_step_over to assert the second command actually executes and add web runner regression tests for skip-through and {{output}} resolution.
The step detail panel renders MESSAGE (rendered Markdown, aimed at every user) ahead of COMMAND (monospace, aimed at engineers), matching the message-first precedence of the interactive prompt panels. The sidebar step list shows the step's first message line as the primary line when one exists, keeping the command available via the tooltip. dist/ rebuilt.
The replace completion message was built from the raw step.command, so
it surfaced unsubstituted {{path}}-style tokens to the user. Resolve the
command with the same substitution used for execution before reporting
it. Regression test added; .gitignore regains a lost newline before the
new local demo/ rule (workflow demo launch targets).
While the session waits on the current step (waiting_ask / waiting_notice / waiting_notify), the generic detail panel — and with it the Command box — is suppressed, so a message-only step showed its notice without ever revealing which command would run. Render the current step's command box inside the three interactive panels as well, after the human-readable message to keep the message-first ordering.
…se (#22, #24) #22 — notify steps with an ask guard no longer gate the user twice: the composed ask dialog IS the notification display, and answering Yes completes the step. Core: _execute_step gains ask_displayed (set when the choice was resolved through the dialog or an ask_callback; an explicit user_choice still shows the message). Web: _advance_session completes a notify step whose ask was answered instead of pausing in waiting_notify. #24 — closing the runner modal mid-workflow no longer strands the session: new POST /api/workflow/{id}/abort marks it aborted ("Aborted by user (modal closed)."), failed note on the interrupted step, idempotent for terminal sessions, 404 on unknown ids. The modal calls it fire-and-forget from the Escape handler, the close button and unmount. Terminal sessions are purged from the in-memory store after a 1h TTL on the next /start. Docs: message display rules state the single-interaction rule (en/fr). The actions integration test that asserted the old double-dialog behavior was updated to the fixed semantics.
The runner modal now aborts its still-interactive session when closed via Escape, the close button, or unmount (fire-and-forget, errors suppressed); terminal sessions are left untouched. dist/ rebuilt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20, Fixes #21, Fixes #22, Fixes #23, Fixes #24
#21 — Skip no longer swallows the next step
The
skip_nextone-shot flag propagated a user's Skip answer to the following step in both engines. Removed in:src/profiles/core/environment/workflow.py(run_workflow): a skip marks only the answered step and continues; the documented last-step rule (skip final step →SKIP_LAUNCH, no OS launch) is unchanged.src/profiles/server/routes/workflow.py:session.skip_nextremoved entirely; the "Skipped by previous step" record note can no longer occur.#23 —
{{output}}resolves in web ask prompts and notices_advance_sessionresolved interactive texts without the captured output while the core engine passes it.session.last_outputis now fed into the_resolve_step_texts/_substitute_variablescalls of the ask, notice and notify branches, matching headless behavior.#20 — Message before command in the runner modal
WorkflowRunnerModal.tsx: the generic step detail panel renders MESSAGE (Markdown, for every user) ahead of COMMAND (monospace, for engineers), matching the message-first precedence of the interactive prompt panels. The sidebar step list shows the step's first message line as the primary line when present; the command stays available via the tooltip. The command box is also rendered inside the three interactive (waiting_*) panels — previously it was suppressed there entirely, so a message-only step never revealed which command would run.#22 — notify + ask is a single interaction
A
notifystep carrying anask:guard used to gate the user twice: the composed ask dialog, then the same message again as a blocking "Continue Workflow" notification. Per the canonical rule, the composed ask dialog is the notification display:_execute_stepgainedask_displayed(set when the choice was resolved through the 3-way dialog or anask_callback; an explicituser_choicestill shows the message, preserving test-override semantics)._advance_sessioncompletes a notify step whose ask was answered instead of pausing again inwaiting_notify.#24 — abort-on-close + session hygiene
POST /api/workflow/{session_id}/abort: marks a still-interactive sessionaborted("Aborted by user (modal closed)."), flags the interrupted step record, is idempotent for terminal sessions and 404s on unknown ids./start, so a long-lived desktop process does not accumulate them.Docs
Tests
test_workflow_skip_step_overstrengthened (asserts the second command executes).{{output}}in ask/notice, replace final-message substitution, notify+ask single gate (core + web), abort endpoint (interactive/idempotent/404/terminal-noop), TTL purge unit test.test_launch_with_confirmation_and_user_confirmsupdated: it asserted the old double-dialog behavior Workflow hooks: notify + ask runs two sequential prompts — the "Continue Workflow" gate appears after the confirmation #22 declares buggy.test_main_without_npm, issue tests/web/test_build.py::test_main_without_npm fails on machines with npm in the fallback dirs #36).