Relationships
#4741 workflow resume ignores globalArgs of direct type execution steps; auto-definition created with empty globalArguments
Opened by thebetternewt · 11/14/2026· Shipped 11/14/2026
Summary
A step using direct type execution (behaviorType + behaviorName + globalArgs) gets its globalArgs on a fresh swamp workflow run, but not when the run is continued with swamp workflow resume --run <id> [--from <step>]. On resume, an auto-definition that does not exist yet is created with globalArguments: {}, and one that exists keeps the globalArgs of its last fresh run. Nothing warns, so the step silently uses the type's defaults.
Impact
With @swamp/git, repoPath falls back to . — the swamp repo — so a resumed workflow committed and pushed in the wrong checkout (and in another run, into a worktree from an earlier, unrelated run).
Reproduce (swamp 20261113.201711.0)
- Workflow with input
dirand three steps:second:type: behavior,behaviorType: "@swamp/git",behaviorName: probe-from-step,methodName: status,globalArgs: { repoPath: ${{ inputs.dir }} }boom:type: assert,expr: inputs.dir == "never"(fails on purpose), depends onsecond
swamp workflow run probe --input dir=<some other git checkout>→ fails atboom.swamp behavior get probe-from-step --jsonshowsglobalArguments: {"repoPath": "<dir>"}— correct.swamp behavior delete probe-from-step --force --yesswamp workflow resume probe --run <id> --from secondswamp behavior get probe-from-step --json→globalArguments: {}. The step ran withrepoPath: ".".
The method-summary report of the resumed step also lists globalArgs: [].
Expected
Resume evaluates globalArgs the same way a fresh run does (from the run's inputs and step outputs), or refuses to resume such a step with an error.
Shipped
Click a lifecycle step above to view its details.
zack commented 11/14/2026, 3:24:41 PM
Thanks @thebetternewt for reporting this! We shipped: workflow resume builds its own direct-type resolver that drops the step's globalArgs (it passes undefined to resolveOrCreateDefinition), so a resumed direct-execution step creates its auto-definition with empty globalArguments or keeps the last fresh run's values. Extract the resolver workflow run already uses into a shared createDirectTypeResolver factory in src/cli and use it from both run and resume, so resume evaluates and persists globalArgs exactly as a fresh run does, and the two copies can no longer drift.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.