Quick Start
1
Record each boundary
Open a run under a stable id and append an event at every model decision and tool result.
2
Resume after a crash
Re-open the same run id, then replay recorded steps so side-effecting tools do not fire twice.
How It Works
The journal records one event per boundary keyed by(run_id, seq, kind). On resume the loop is re-driven from the top; journalled steps return their recorded payload instantly, and only un-journalled steps do real work.
A run moves through three states:
Event Kinds
Each boundary is recorded under akind. Recorded results replay on resume instead of re-executing.
Configuration Options
RunJournal(db_path=None) β the constructor is the whole surface.
Key methods:
Common Patterns
Long-running scheduled job that survives a container restart:approval decision is journalled β see Durable Approvals.
Best Practices
Use a stable run id per business transaction
Use a stable run id per business transaction
Key the run on the order id, ticket id, or job id (
"order-A-1042") so a restart can find the right journal row with interrupted_runs() or replay_index().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. Pass an explicit path on a mounted volume, e.g. RunJournal("/data/praisonai/journal.db").Keep tools idempotent as belt-and-braces
Keep tools idempotent as belt-and-braces
The journal prevents re-execution of recorded completions. A tool that crashed before its
tool_result was appended still needs an idempotency key at the tool layer.Do not reuse a run id across different tasks
Do not reuse a run id across different tasks
The journal keys on
run_id verbatim. Reusing an id for a different task replays the wrong recorded steps.Related
Run-State Journal
The SQLite layer under durable runs.
Durable Approvals
The
approval event β pause-for-approval that survives a restart.Execution
Agent execution limits and configuration.
Gateway Session Persistence
Persist gateway sessions across restarts.

