← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone
Relationships
#3109 Settle expired signal waits from swamp serve
Opened by hammz · 10/6/2026
Problem
Split out of swamp-club#3094. A wait_for_signal deadline is noticed only when something looks: workflow signal, workflow waits and workflow resume each settle an overdue wait as timed_out (outcomeAt in src/domain/workflows/signal_wait_cleanup.ts). Under swamp serve nothing looks, so an expired wait stays suspended and its failed handlers do not run until someone resumes the run.
Proposal
- The continuation sweep of swamp-club#3108 also lists registered waits and, for each one past its deadline with no outcome, creates a
timed_outoutcome and attempts continuation. Every instance may sweep; the create decides between a timeout and a signal arriving at the same moment. - After downtime, overdue waits are caught up on the first sweep. The deadline is absolute; how soon the handlers run depends on serve being up.
- A maximum timeout configured on serve. Today one year is hard-coded in the task schema.
Open decisions
- The maximum timeout: where it is enforced (when the workflow is validated, or when the wait opens) and what happens to a wait already open with a longer one.
- Whether an expired approval gate should be failed by the sweep. Today it stays suspended (
evaluateApprovalTimeoutis checked only on approve, reject and listing); changing it alters existing workflows. - Whether the sweep settles waits on a custom datastore, where this host may not have the run record. Settling needs only the registration; continuing needs the run.
Acceptance criteria
- A wait past its deadline fails its step with
wait_timeout, and itsfailedhandler runs, with no client action. - Waits that expired while serve was down are settled on the first sweep after boot.
- A signal accepted before the deadline still holds when the sweep runs after it.
Tests
- Integration tests with a fake clock and ordered creates, never sleeps: signal against timeout, deadline catch-up after downtime, two instances sweeping the same wait.
Depends on
swamp-club#3108 (continuation claim and sweep). Without it a timed-out wait would be settled but its run not resumed.
References
swamp-club#3094, swamp-club#3093, the Timing out paragraph of the Wait for Signal section in design/primitives/workflows.md.
02Bog Flow
Open
No activity in this phase yet.
03Sludge Pulse
Sign in to post a ripple.