Quick Start
Migration (PR #4218). Prior releases required
gateway.durable_runs: true to opt in. The default is now on whenever your session store is durable β no config change needed to gain crash-safe resume. Want the old zero-overhead behaviour? Set gateway.durable_runs: false or gateway.reliability: "off".1
Zero-config default (crash-safe out of the box)
Sessions persist by default, so durable runs are already on β no Restart the gateway mid-run and the interrupted turn resumes β recorded tool results replay from the
gateway: block required:RunJournal instead of re-charging the card or re-billing the model.2
Opt out (zero-overhead path)
Two explicit escape hatches turn durable runs off:In-memory sessions disable it too β with
session.persist: false there is no durable store to journal against, so durable runs silently stay off.3
Override per agent
A per-agent
durable flag wins in both directions β opt one agent out even when the gateway default is on, or opt one in even when itβs off:4
Toggle the default off from the environment
gateway.durable_runs accepts an ${ENV_VAR}-substituted string. Because ${DURABLE} renders as a string, the value is coerced explicitly β "false"/"0"/"no"/"off"/"" disable, and "true"/"1"/"yes"/"on" enable:How It Works
Each gateway agent journals its turn to the coreRunJournal; a restart re-drives the loop from the top, replaying journalled steps and running only the un-journalled ones. Whether journalling runs at all is decided from config plus the effective session store.
Choosing whether durable runs run
Precedence ladder: per-agentdurable > explicit gateway.durable_runs > gateway.reliability: "off" (forces off) > effective session store (auto-on when durable, off when in-memory).
The durable-runs decision is re-evaluated on every load path β initial load, full-restart reload, and selective reload β so restarting the gateway keeps durability wired.
Zero overhead when off. On an opted-out path the execution hot path is unchanged and
ExecutionConfig is never imported.Graceful degrade. If
ExecutionConfig canβt be imported (an older core), the gateway logs a warning and the agent runs non-durably β the gateway never fails to start over durability.How to opt out
There are three ways to end up withdurable_runs=false, plus one silent fallback:
- Explicit off β set
gateway.durable_runs: false. - Reliability off β set
gateway.reliability: "off"(the immediate-teardown posture forces durable runs off for the zero-overhead path). - No durable store β set
session.persist: false; with no store to journal against, durable runs auto-default to off. - Silent fallback β
session.persist: truebut the persistent store failed to initialise (e.g. absent or read-only~). The gateway logs the fallback and stays non-durable β worth checking, because operators otherwise assume their intent is honoured.
Configuration Options
The underlying agent primitive is
ExecutionConfig(durable=True) β see that page for journal_path, resume_run_id, and the resume contract.
Common Patterns
Fleet-wide durability with a chit-chat escape hatch β durable runs are already on by default, so opt out only the agents that make small talk:Best Practices
Point journal_path at a persistent volume in containers
Point journal_path at a persistent volume in containers
The default
~/.praisonai/runs/journal.db is lost when a container is recreated. Configure a mounted volume so the journal survives restarts β see Durable Tool Runs.Verify the store actually initialised
Verify the store actually initialised
Durable runs only auto-enable when the session store instantiates. On an absent or read-only home directory the store degrades to in-memory and durable runs silently stay off β check the gateway log for the fallback if you expected crash-safe resume.
Per-agent durable is your escape hatch
Per-agent durable is your escape hatch
Small-talk agents donβt need journalling. Set
durable: false on them, keeping the hot path clean for stateless turns even while the gateway default is on.Compose with session persistence
Compose with session persistence
Durable gateway runs and session persistence are different layers β one resumes the in-flight turn, the other restores conversation history. Both survive a restart and work together.
Related
Durable Tool Runs
The underlying agent primitive β
ExecutionConfig(durable=True).Run-State Journal
The SQLite journal durable runs write to.
Gateway Session Persistence
The durable store durable runs auto-enable against.
Gateway Reliability
reliability: "off" forces durable runs off.
