Skip to content

recordSessionSafe

recordSessionSafe(config, record): number | null

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/history/recordSession.ts:28

Record one finished session IFF history.enabled is true. Returns the new row id, or null when history is disabled or anything went wrong (both are non-events for the caller).

Deliberately fully guarded: opening the store, ensuring the global dir, and the insert all run behind a single try/catch, and the store itself is fail-soft. Callers put this in a finally (or after a run) without a try/catch of their own.

HistoryConfigView

SessionRecord

number | null