Class: Rubino::Tools::BackgroundTasks::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubino/tools/background_tasks.rb

Overview

last_activity / tool_count / activity_log — live-progress fields written by a subagent’s UI::CLI#tool_started / #tool_finished (via #record_tool_started / #record_tool_finished) under the registry mutex and read by the parent renderer (UI::SubagentCards) and the /agents drill-in. activity_log is a bounded ring of the last few ‘✓ verb · hint` lines for the live drill-in; output_tail is the bounded line buffer of the CURRENTLY RUNNING tool’s streamed output (fed by #record_tool_output, wiped at #record_tool_finished) that the drill-in’s output: block tails (#5). Nothing is persisted (it dies with the process, like the rest of the registry).

approval_gate / approval_question / approval_command are the Option-2 approval-surfacing state: when a background child’s tool needs approval the child thread parks on ‘approval_gate` (a Run::ApprovalGate) and the entry flips to status :needs_approval with the question/command shown on the card; the user resolves it via /agents <id>.

budget_request (#574) REUSES that exact :needs_approval gate for a different ask: a BACKGROUND child that hit its tool-iteration ceiling parks on the same gate to ask the human for MORE budget instead of silently force-summarizing. The flag only re-flavors the surfaces (card / menu row / the /agents resolve prompt read “wants +budget — grant?”, and the allowlist-persisting “always” option is dropped — there is no command to remember); the parking/wake/stop-cancel plumbing is identical.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#activity_logObject

Returns the value of attribute activity_log

Returns:

  • (Object)

    the current value of activity_log



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def activity_log
  @activity_log
end

#approval_commandObject

Returns the value of attribute approval_command

Returns:

  • (Object)

    the current value of approval_command



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def approval_command
  @approval_command
end

#approval_gateObject

Returns the value of attribute approval_gate

Returns:

  • (Object)

    the current value of approval_gate



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def approval_gate
  @approval_gate
end

#approval_idObject

Returns the value of attribute approval_id

Returns:

  • (Object)

    the current value of approval_id



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def approval_id
  @approval_id
end

#approval_questionObject

Returns the value of attribute approval_question

Returns:

  • (Object)

    the current value of approval_question



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def approval_question
  @approval_question
end

#approval_seqObject

Returns the value of attribute approval_seq

Returns:

  • (Object)

    the current value of approval_seq



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def approval_seq
  @approval_seq
end

#ask_blockingObject

Returns the value of attribute ask_blocking

Returns:

  • (Object)

    the current value of ask_blocking



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def ask_blocking
  @ask_blocking
end

#ask_gateObject

Returns the value of attribute ask_gate

Returns:

  • (Object)

    the current value of ask_gate



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def ask_gate
  @ask_gate
end

#ask_idObject

Returns the value of attribute ask_id

Returns:

  • (Object)

    the current value of ask_id



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def ask_id
  @ask_id
end

#ask_optionsObject

Returns the value of attribute ask_options

Returns:

  • (Object)

    the current value of ask_options



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def ask_options
  @ask_options
end

#ask_questionObject

Returns the value of attribute ask_question

Returns:

  • (Object)

    the current value of ask_question



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def ask_question
  @ask_question
end

#budget_requestObject

Returns the value of attribute budget_request

Returns:

  • (Object)

    the current value of budget_request



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def budget_request
  @budget_request
end

#depthObject

Returns the value of attribute depth

Returns:

  • (Object)

    the current value of depth



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def depth
  @depth
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def error
  @error
end

#finished_atObject

Returns the value of attribute finished_at

Returns:

  • (Object)

    the current value of finished_at



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def finished_at
  @finished_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def id
  @id
end

#last_activityObject

Returns the value of attribute last_activity

Returns:

  • (Object)

    the current value of last_activity



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def last_activity
  @last_activity
end

#last_probe_atObject

Returns the value of attribute last_probe_at

Returns:

  • (Object)

    the current value of last_probe_at



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def last_probe_at
  @last_probe_at
end

#output_tailObject

Returns the value of attribute output_tail

Returns:

  • (Object)

    the current value of output_tail



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def output_tail
  @output_tail
end

#owner_subagent_idObject

Returns the value of attribute owner_subagent_id

Returns:

  • (Object)

    the current value of owner_subagent_id



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def owner_subagent_id
  @owner_subagent_id
end

#parent_sinkObject

Returns the value of attribute parent_sink

Returns:

  • (Object)

    the current value of parent_sink



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def parent_sink
  @parent_sink
end

#probe_countObject

Returns the value of attribute probe_count

Returns:

  • (Object)

    the current value of probe_count



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def probe_count
  @probe_count
end

#promptObject

Returns the value of attribute prompt

Returns:

  • (Object)

    the current value of prompt



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def prompt
  @prompt
end

#resultObject

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def result
  @result
end

#runnerObject

Returns the value of attribute runner

Returns:

  • (Object)

    the current value of runner



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def runner
  @runner
end

#started_atObject

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def status
  @status
end

#steer_queueObject

Returns the value of attribute steer_queue

Returns:

  • (Object)

    the current value of steer_queue



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def steer_queue
  @steer_queue
end

#subagentObject

Returns the value of attribute subagent

Returns:

  • (Object)

    the current value of subagent



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def subagent
  @subagent
end

#threadObject

Returns the value of attribute thread

Returns:

  • (Object)

    the current value of thread



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def thread
  @thread
end

#tool_countObject

Returns the value of attribute tool_count

Returns:

  • (Object)

    the current value of tool_count



60
61
62
# File 'lib/rubino/tools/background_tasks.rb', line 60

def tool_count
  @tool_count
end

Instance Method Details

#messagesObject

The child subagent’s FULL persisted transcript. A background child runs its own Agent::Runner with its own session, so its complete message history (its tool calls + what it said) lives in the session store under ‘runner.session` — the agent-attach view replays exactly this. Empty when no runner/session is wired (sync/foreground/headless spawn).



121
122
123
124
# File 'lib/rubino/tools/background_tasks.rb', line 121

def messages
  session_id = runner&.session&.dig(:id)
  session_id ? ::Rubino::Session::Store.new.for_session(session_id) : []
end