Declare on `DurabilityEngineSpec` whether an engine replays orchestrator code, can wake its loop from a thread, and bounds blocking orchestrator code
Written by Claude Code on behalf of @DouweM.
Part of #14525
Why we make these changes
This is the base of the Azure Code Mode stack. It declares three facts about how an engine runs durable-container (orchestrator) code on DurabilityEngineSpec, so capabilities can read them from the spec instead of checking engine names:
- #14523 refuses Code Mode configs that rely on
bounds_blocking_orchestrator_code; Douwe ruled the field must exist before #14523 merges, so the fields land here, below it. - #14855 then switches Code Mode and
DynamicWorkflowto read the fields.
This PR adds the fields and the built-in engines' values only, with no consumers.
| Engine | replays_orchestrator_code | thread_wakeable_loop | bounds_blocking_orchestrator_code |
|---|---|---|---|
| Temporal | True | False | True (deadlock detector fails the workflow task after 2 s) |
| Azure Durable Task | True | False | False |
| DBOS | True (recovery re-runs the workflow; steps matched by position, DBOSUnexpectedStepError on divergence) | True | False |
| AWS Lambda | True (handler re-run; steps matched in order, NonDeterministicExecutionError on divergence) | True | False |
| Absurd | True (handler re-run; checkpoints found by name and occurrence count) | True | False |
| pgtask | True (task re-run; TaskSteps maps steps to checkpoints in order) | True | False |
| Prefect | False (caches task results by input, not position) | True | False |
| Render | False (a retried run restarts with no recorded progress) | True | False |
bounds_blocking_orchestrator_code matters only where replays_orchestrator_code is True.
New public surface
DurabilityEngineSpec.replays_orchestrator_codeDurabilityEngineSpec.thread_wakeable_loopDurabilityEngineSpec.bounds_blocking_orchestrator_code
Verification
- Spec values are pinned in
tests/durable_exec/temporal/test_durability.py,tests/harness/azure_durable_task/test_capability.pyand, for the defaults,tests/durable_exec/test_durable_exec_compat.py. check_api_compatibility.py --against v2.77.0exits 0 on the PR merged withmain, with five waivers: theengine_specvalues of Azure Durable Task, DBOS, AWS Lambda, Absurd and pgtask. Temporal's spec is a module constant, so Griffe sees no change there.scripts/durable_exec_contract.py --write: manifest unchanged.
Decisions
replays_orchestrator_codevalues corrected after a per-engine evidence check: DBOS (dbos/_sys_db.pyraisesDBOSUnexpectedStepErrorwhen a replayed step doesn't match its recorded position), AWS Lambda (handler re-run, steps matched in order,NonDeterministicExecutionError), Absurd (handler re-run, checkpoints by name and occurrence count) and pgtask (TaskStepsmaps replayed steps to checkpoints in order,pgtask/_context.py) all re-run container code and need the replay to take the recorded path, so they set it toTrue. Prefect (caches by input, not position) and Render (restarts with no recorded progress) keepFalse. The old "keep the default for now (#12539)" note is gone: #12539 is closed, fixed by #13527.thread_wakeable_loopandbounds_blocking_orchestrator_codevalues were checked and are unchanged.- No new pre-push review for that correction: it is four one-line declaration values plus matching docs, backed by the engine evidence above, and nothing reads the field in this PR.
- In DBOS and AWS Lambda the new keyword sits earlier in the spec call, away from
nondeterminism_error_types(#13527, onmain), so the PR still merges cleanly without amainmerge.
What changes for existing users
Nothing: no code reads the new fields yet.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
Summary by cubic
Adds three fields to DurabilityEngineSpec — replays_orchestrator_code, thread_wakeable_loop, and bounds_blocking_orchestrator_code — declaring how an engine runs durable-container code, so future features can read engine capabilities from the spec instead of checking engine names. No code reads the fields yet; thread_wakeable_loop defaults to True so engine specs written before the field existed keep long-standing behavior.
- Defaults are
False,True,False; Temporal declaresTrue,False,Trueand Azure Durable Task declaresTrue,False,False. - DBOS, Hatchet, AWS Lambda, Absurd, and pgtask set
replays_orchestrator_code=True: each re-runs container code on recovery and requires the replay to match the recorded path — Absurd by checkpoint name and occurrence count, the rest by position (AWS SDK 2.0+ raisesNonDeterministicExecutionErroron divergence). Prefect (caches by input) and Render (restarts with no recorded progress) keep the default. bounds_blocking_orchestrator_codeonly matters wherereplays_orchestrator_codeisTrue.- Adds four API-compatibility waivers against v2.78.0 for the harness engines whose spec sets the new fields (DBOS, Temporal, and Hatchet specs are module constants, so Griffe sees no change there), and pins the declared values in tests that involve no provider request.