module RubyLLM::Browser::Rails
Durable, multi-worker adapter for hosts that run Rails (or plain ActiveRecord + Active Job). It provides an ActiveRecord operation/approval store, a scoped Active Job, and a cleanup reaper. It never guesses provider truth and never starts a session the core would refuse.
Attributes
approval_store[W]
clock[W]
context_factory[RW]
->(actor_id:, run_id:) { RubyLLM::Browser::Context }, supplied by the host.
job_queue[W]
operation_store[W]
Public Class Methods
approval_store()
click to toggle source
Durable approval store. Defaults to an {ActiveRecordApprovalStore}.
# File lib/ruby_llm/browser/rails.rb, line 63 def approval_store @approval_store ||= ActiveRecordApprovalStore.new end
clock()
click to toggle source
Returns the current UTC time used by the adapter.
# File lib/ruby_llm/browser/rails.rb, line 45 def clock @clock ||= -> { Time.now.utc } end
job_queue()
click to toggle source
The Active Job queue name. Defaults to ‘:default`.
# File lib/ruby_llm/browser/rails.rb, line 51 def job_queue @job_queue || :default end
operation_store()
click to toggle source
Durable operation store. Defaults to an {ActiveRecordOperationStore}.
# File lib/ruby_llm/browser/rails.rb, line 57 def operation_store @operation_store ||= ActiveRecordOperationStore.new end
reset!()
click to toggle source
Restores process defaults. Primarily a test helper.
# File lib/ruby_llm/browser/rails.rb, line 69 def reset! @context_factory = nil @clock = nil @job_queue = nil @operation_store = nil @approval_store = nil end