Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublicTeam
Assigneesstack72

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

  1. Create a workflow with required string input label and a manual approval prompt Approval marker: ${{ inputs.label }}.
  2. Run it with label=marker-one; it suspends at approval.
  3. Run it again with label=marker-two; it also suspends at approval.
  4. 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.ts provides YamlEvaluatedWorkflowRepository.findById(workflowId) to the approval service.
  • src/libswamp/workflows/approvals.ts declares evaluatedWorkflow outside 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.ts writes 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.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/18/2026, 4:21:08 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/18/2026, 2:57:00 PM
Editable. Press Enter to edit.

stack72 commented 8/18/2026, 4:25:49 PM

Thanks @jeremy for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.