Class: Rubino::Commands::Handlers::Jobs

Inherits:
Object
  • Object
show all
Defined in:
lib/rubino/commands/handlers/jobs.rb

Overview

The ‘/jobs` in-chat window into the PERSISTENT jobs queue (#187), extracted from Commands::Executor (batch B) — the queue the agent itself feeds mid-session (DistillSkillJob after tool-heavy turns, memory extraction), distinct from the in-process /agents subagents. Read-mostly: `process`/`worker` stay CLI-only (they are daemons, not session actions).

/jobs        → status counts + the recent-jobs table (the SAME
               rendering as `rubino jobs list` — JobsCommand.render_list)
/jobs <id>   → one job in full (attempts, payload, last error);
               short-id prefixes resolve, like /memory show

Constant Summary collapse

STATUS_ORDER =

Render order for the /jobs counts header (#187) — lifecycle order, not the arbitrary GROUP BY order (any unknown status is appended).

%w[queued running completed failed dead].freeze

Instance Method Summary collapse

Constructor Details

#initialize(ui:) ⇒ Jobs

Returns a new instance of Jobs.



21
22
23
# File 'lib/rubino/commands/handlers/jobs.rb', line 21

def initialize(ui:)
  @ui = ui
end

Instance Method Details

#handle_jobs(arguments) ⇒ Object



25
26
27
28
# File 'lib/rubino/commands/handlers/jobs.rb', line 25

def handle_jobs(arguments)
  id = arguments.to_s.strip.split(/\s+/).first
  id.nil? ? show_jobs_list : show_job_detail(id)
end