Relationships
#1705 workflow approvals displays the latest run's prompt for every suspended run
Opened by jeremy · 8/18/2026· Shipped 8/18/2026
Summary
When a workflow has more than one suspended manual_approval run whose prompts resolve differently from inputs, swamp workflow approvals --json displays the most recently evaluated prompt for every pending run. Each run retains its own persisted inputs, but the older run's displayed prompt is rewritten with the newer run's values.
This makes the displayed approval prompt fail to identify the exact suspended run being approved.
Environment
- Swamp
20260818.015459.0-sha.7d509529 - Local filesystem workspace on Linux
Reproduction
- Create a workflow with required string input
labeland a manual approval promptApproval marker: ${{ inputs.label }}. - Run it with
label=marker-one; it suspends at approval. - Run it again with
label=marker-two; it also suspends at approval. - Run
swamp workflow approvals --json.
Actual result
The older run reports persisted input label: marker-one, but its listed prompt is Approval marker: marker-two. The newer run correctly displays Approval marker: marker-two.
Concrete run IDs from the reproduction:
- workflow ID:
0c4c3de8-6f75-49d0-85b1-edda894d25c4 - marker-one run:
9f3127a8-3d42-4077-a221-e5c1e4725afa - marker-two run:
d4640821-6648-469a-9c5c-07ce0d114cc9
The suspended-run YAML files correctly retain their distinct inputs.
Expected result
Each pending approval must display the resolved prompt that belonged to that specific suspended run:
- marker-one run:
Approval marker: marker-one - marker-two run:
Approval marker: marker-two
simultaneously. A manual approval is not meaningful when its prompt can describe a different suspended run.
Source diagnosis
Version-matched source was fetched with swamp source fetch.
src/cli/commands/workflow_approvals.tsprovidesYamlEvaluatedWorkflowRepository.findById(workflowId)to the approval service.src/libswamp/workflows/approvals.tsdeclaresevaluatedWorkflowoutside the loop over suspended runs, resolves it once by workflow ID, and uses that prompt for every pending run of the workflow.src/infrastructure/persistence/yaml_evaluated_workflow_repository.tswrites one evaluated artifact per workflow at.swamp/workflows-evaluated/workflow-{name}.yaml, not one per run.
The later evaluation therefore replaces the artifact that the earlier run's listing consults. Existing tests cover a single evaluated prompt, but not two suspended runs with distinct expression-resolved prompts.
Suggested repair and regression test
Persist the resolved manual-approval prompt, or an immutable evaluated-task snapshot, with the run/step when it enters waiting_approval; render the listing from that run-bound value. Do not re-evaluate the current workflow at listing time, because the definition or referenced values may change after suspension.
Add a regression test that creates the two suspended runs above and asserts that workflow approvals --json shows each run's own resolved prompt at the same time.
Shipped
Click a lifecycle step above to view its details.