fix(flow): allow resuming flows with bash steps (v1.55.1) - #187
Merged
paulkr merged 1 commit intoAug 11, 2026
Merged
Conversation
`flow resume` was registered with zero options, and flowResumeCommand called runner.resume() without allowBash. FlowRunner.resume already accepts FlowExecuteOptions, which supports the field — it was simply never populated, and no flag existed to populate it from. So resuming any flow containing a bash step threw "Bash steps require --allow-bash flag for security" with no way to satisfy it. Resume is the recovery path for a paused or failed run, so a scheduled bash flow that failed was permanently unrecoverable. Surfaced while triaging #186 (Clockwork), where 76 of 110 flows use bash steps and run on a scheduler. - Registers --allow-bash on `flow resume`, threaded through to runner.resume. - Adds the same fail-fast pre-flight `flow execute` runs, so the caller gets {error, requiresBash, flowKey, runId} up front instead of a mid-run engine error partway through a partially-completed resume. Second fix, needed to test the first: `src/commands/update.ts` resolved `require('../package.json')` from two levels down, which only exists in the bundled dist/ layout. From source it threw MODULE_NOT_FOUND at import time, so importing the command tree — and therefore ANY test of the commander registration — died before running. `src/lib/analytics.ts` had the identical bug but swallowed it, silently reporting every telemetry event in a source checkout as version "unknown". Both now use lib/version.ts, which walks upward for package.json the same way builtin-profiles.ts locates profiles/. Verified in both layouts: the suite imports the command tree from source, and the built CLI still reports 1.55.1. 8 new tests. The command-registration ones assert the flag's attributeName() maps to `allowBash` and matches how `flow execute` declares it — registering a flag but reading a differently-named property would leave it undefined and the gate would still reject, with nothing looking wrong.
paulkr
approved these changes
Aug 11, 2026
paulkr
deleted the
feature/int-4409-flow-resume-cannot-resume-any-flow-containing-a-bash-step
branch
August 11, 2026 16:28
This was referenced Aug 11, 2026
paulkr
pushed a commit
that referenced
this pull request
Aug 13, 2026
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.
INT-4409 · found while triaging #186
Problem
one flow resume <runId>was registered with zero options (cli.ts:572), andflowResumeCommandcalledrunner.resume(flow, api, permissions, actionIds, { onEvent, rootDir })— noallowBash(flow.ts:605).FlowRunner.resumealready takesFlowExecuteOptions, which supports the field. It was simply never populated, and no flag existed to populate it from. So resuming any flow with a bash step threw:with no way to satisfy it. Resume is the recovery path for a paused or failed run, so a bash flow that failed was permanently unrecoverable.
Found while triaging #186 (Clockwork), where 76 of 110 flows use bash steps and run on a scheduler — exactly the case where a failed run needs resuming. (The four defects in #186 itself are all Clockwork's; nothing there needs a CLI change.)
Changes
--allow-bashonflow resumeand threads it through torunner.resume.flow executeruns, so a caller gets{error, requiresBash, flowKey, runId}up front rather than a mid-run engine error partway through a partially-completed resume.The permission is deliberately not inherited from the original run — resuming re-grants shell execution, so it should be re-stated. Documented in README and
flows.md.Second fix — required to test the first
src/commands/update.tsresolvedrequire('../package.json')from two levels down. That path only exists in the bundleddist/layout; from source it resolves tosrc/package.json, which doesn't exist. It threwMODULE_NOT_FOUNDat import time, so importing the command tree — and therefore any test of the commander registration — died before running. This is why the command layer has almost no tests.src/lib/analytics.tshad the identical bug but swallowed it in atry/catch, silently reporting every telemetry event from a source checkout as version"unknown".Both now use
lib/version.ts, which walks upward forpackage.jsonthe same waybuiltin-profiles.tsalready locatesprofiles/. It's a genuine (small) scope addition, and I'd rather flag it than bury it — but the alternative was shipping the fix with no test of the thing that was broken.Verified in both layouts, since that was the regression risk:
node bin/cli.js --versionon the rebuilt bundle still reports1.55.1node bin/cli.js flow resume --helplists--allow-bashTests
8 new; 465 total, 0 skipped, all passing.
The registration tests assert
attributeName()maps toallowBashand matches howflow executedeclares the same flag — registering a flag but reading a differently-named property would leave itundefined, the gate would still reject, and nothing would look wrong. That's the failure mode worth pinning, not merely "an option exists".