Class: Ace::Assign::CLI::Commands::ForkSession

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/assign/cli/commands/fork_session.rb

Overview

Internal command used by tmux-backed fork panes to launch the provider session once.

Instance Method Summary collapse

Constructor Details

#initialize(launcher: nil) ⇒ ForkSession

Returns a new instance of ForkSession.



22
23
24
25
# File 'lib/ace/assign/cli/commands/fork_session.rb', line 22

def initialize(launcher: nil)
  super()
  @launcher = launcher || Molecules::ForkSessionLauncher.new
end

Instance Method Details

#call(**options) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ace/assign/cli/commands/fork_session.rb', line 27

def call(**options)
  launcher.launch_provider_session(
    assignment_id: options[:assignment],
    fork_root: options[:root],
    provider: options[:provider],
    cli_args: options[:cli_args],
    timeout: options[:timeout],
    cache_dir: options[:cache_dir],
    last_message_file: options[:last_message_file],
    session_meta_file: options[:session_meta_file]
  )

  0
rescue Error, Ace::LLM::Error => e
  warn e.message
  1
end