Skip to main content
Turn on one flag in gateway.yaml and every gateway agent journals its turns, so a gateway restart resumes an interrupted run instead of re-firing side-effecting tools or re-billing LLM calls.

Quick Start

1

Enable for every gateway agent

One flag opts every gateway agent into durable runs β€” each agent is constructed with execution=ExecutionConfig(durable=True):
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

Override per agent

A per-agent durable flag wins in both directions β€” opt one agent in even when the gateway default is off, or opt one out even when it’s on:
3

Wire it from the environment

gateway.durable_runs accepts an ${ENV_VAR}-substituted string. Because ${DURABLE} renders as a string, the value is coerced explicitly β€” "true"/"1"/"yes"/"on" enable, and "false"/"0"/"no"/"off"/"" disable:
"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.
The durable_runs value is passed through on every load path β€” initial load, full-restart reload, and selective reload β€” so restarting the gateway keeps durability wired.
Zero overhead when off. With neither flag set 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.

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 β€” journal the agents that touch money or ship goods, skip the ones that only 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.
Wire durable_runs: ${DURABLE} and toggle per environment. Remember the string "false" really disables durability here β€” the coercion exists precisely so bool("false") never silently enables it.
Small-talk agents don’t need journalling. Set durable: false on them even when the gateway default is on, keeping the hot path clean for stateless turns.
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

Sibling gateway-side durability for conversation state.

Gateway Overview

The full gateway config surface.