Skip to main content
Gateway agents journal every turn by default, so a gateway restart resumes an interrupted run instead of re-firing side-effecting tools or re-billing LLM calls. No flag needed β€” it auto-enables whenever your session store is durable (the shipped default). Two explicit opt-outs are supported for the zero-overhead path.

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 gateway: block required:
Restart the gateway mid-run and the interrupted turn resumes β€” recorded tool results replay from the 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:
"false" really means false here. Without this coercion, bool("false") would be truthy and silently enable durability.

How It Works

Each gateway agent journals its turn to the core RunJournal; 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-agent durable > 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 with durable_runs=false, plus one silent fallback:
  1. Explicit off β€” set gateway.durable_runs: false.
  2. Reliability off β€” set gateway.reliability: "off" (the immediate-teardown posture forces durable runs off for the zero-overhead path).
  3. No durable store β€” set session.persist: false; with no store to journal against, durable runs auto-default to off.
  4. Silent fallback β€” session.persist: true but 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:
Toggle by environment β€” durable in production, off in ephemeral CI:

Best Practices

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.
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.
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.
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.

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.