class RubyLLM::AgUI::Resume

The answers a run’s input gives to a previous run’s interrupts (FR-06).

A resume is a request, never a permission grant. Before anything is written, every entry is checked against the live state: it must name an interrupt of the *most recent* interrupted run on the same thread, the tool call it concerns must still be pending on the host’s chat, and that call’s arguments must still digest to what the interrupt recorded, so a resume cannot change what it approves. The decision is then recorded once; a repeated resume is refused rather than executed again, because the tool may already have run.

An approval answers an interrupt. The host still re-authorizes the actor before the tool executes.

Constants

Decision

One entry’s effect: the interrupt it answers and the decision to record.

Public Class Methods

new(input:, store:, scope:, chat:) click to toggle source
# File lib/ruby_llm/ag_ui/resume.rb, line 22
def initialize(input:, store:, scope:, chat:)
  @input = input
  @store = store
  @scope = scope
  @chat = chat
  @plan = []
end

Public Instance Methods

apply(now:) click to toggle source

Records each planned decision once and tells the chat about it, so the next completion runs an approved tool or refuses a denied one.

# File lib/ruby_llm/ag_ui/resume.rb, line 45
def apply(now:)
  @plan.each { |planned| redeem(planned, now: now) }
  self
end
needed?() click to toggle source

Whether the input answers anything at all.

# File lib/ruby_llm/ag_ui/resume.rb, line 31
def needed?
  @input.resume?
end
plan(now:) click to toggle source

Checks every entry and builds the plan. Writes nothing, so a rejected resume is rejected before the run opens a stream.

# File lib/ruby_llm/ag_ui/resume.rb, line 37
def plan(now:)
  source = interrupted_run
  @plan = @input.resume.map { |entry| plan_entry(source, entry, now) }
  self
end