Class: Ralph::Agents::Codex

Inherits:
Base
  • Object
show all
Defined in:
lib/ralph/agents/codex.rb

Instance Method Summary collapse

Methods inherited from Base

#build_env, #collect_tool_counts, #detect_fatal_error, #execute, #extract_errors, #validate!

Methods included from Helpers

#check_completion, #escape_regex, #format_duration, #format_duration_long, #format_tool_summary, #now_ms, #strip_ansi, #which

Instance Method Details

#build_args(prompt, model, options) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/ralph/agents/codex.rb', line 11

def build_args(prompt, model, options)
  args = ["exec"]
  args.push("--model", model) if model && !model.empty?
  args.push("--full-auto") if options && options[:allow_all_permissions]
  args.push(prompt)
  args
end

#commandObject



8
# File 'lib/ralph/agents/codex.rb', line 8

def command = "codex"

#config_nameObject



9
# File 'lib/ralph/agents/codex.rb', line 9

def config_name = "Codex"

#parse_tool_output(line) ⇒ Object



19
20
21
22
# File 'lib/ralph/agents/codex.rb', line 19

def parse_tool_output(line)
  match = strip_ansi(line).match(/(?:Tool:|Using|Calling|Running)\s+([A-Za-z0-9_-]+)/i)
  match ? match[1] : nil
end

#typeObject



7
# File 'lib/ralph/agents/codex.rb', line 7

def type = :codex