Skip to Content
Huggler Docs

Durability and recovery

Reopen a conversation, retry a command, and restore a live view.

One database, one owner

Keep one runtime open per SQLite database. Close it and wait for shutdown before reopening the database in another process. A compatible runtime can recover thread identities, history, queue state, and receipts from the same file.

By default the database is huggler.sqlite3 under the state directory. A database override can be absolute or relative to that directory. The runtime lock and SQLite sidecars sit alongside the database. Worktree reservations carry absolute paths, so storage configuration changes apply to future reservations.

Acceptance and delivery happen separately

Huggler commits a command’s receipt and local effects together. Keep the command ID, thread, and payload together. Retry with those same values to recover the original receipt. Reusing an ID with a different intent yields a conflict.

The provider runs after the local commit. A send that was accepted and never claimed can reopen as failed and unsent. If the process exits after provider I/O, the recovered run can report uncertain delivery. Inspect the run before deciding whether to send a replacement. An identical command retry returns the original receipt without submitting another prompt.

Recover a view from its cursor

For a new view, start with the subscription snapshot. Apply events that arrive after its cursor. Persist the view together with the last event sequence it has processed.

To resume a saved view, request replay after that saved sequence and apply the events to the saved view. The snapshot returned with the replay already includes changes through its own cursor. If retention has removed events needed for replay, rebuild from a fresh snapshot. History pagination and command output use separate cursors.

Keep the native session binding

Preserve the original provider instance and its configuration for native continuation. A portable fork or file import supplies a bounded history prefix for a new provider session.

Subscription APIs

On this page