class RubyLLM::AgUI::Rails::ActiveRecordStore

The durable run store: run identity in a table instead of a process.

The in-process store is correct for one process only. A host that runs more than one Puma worker, or that restarts, needs the reservation, the interrupts and the terminal status to outlive the worker that produced them, which is what this store is for.

Ordering is by row id, so โ€œthe latest run on the threadโ€ means the run reserved last, not the run whose clock reading is largest. Two requests that arrive in the same millisecond still have an order.

RubyLLM::AgUI.configure { |config| config.run_store = ActiveRecordStore.new }