Class: CollavreOpenclaw::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/collavre_openclaw/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/collavre_openclaw/configuration.rb', line 28

def initialize
  @open_timeout = ENV.fetch("OPENCLAW_OPEN_TIMEOUT", 10).to_i
  @read_timeout = begin
    Collavre::SystemSetting.llm_request_timeout_seconds
  rescue StandardError
    1800
  end
  @max_retries = ENV.fetch("OPENCLAW_MAX_RETRIES", 2).to_i
  @ws_idle_timeout = ENV.fetch("OPENCLAW_WS_IDLE_TIMEOUT", 1800).to_i     # 30 minutes
  @ws_reconnect_max = ENV.fetch("OPENCLAW_WS_RECONNECT_MAX", 10).to_i
  @ws_reconnect_base_delay = ENV.fetch("OPENCLAW_WS_RECONNECT_BASE", 1).to_f
  @ws_connect_timeout = ENV.fetch("OPENCLAW_WS_CONNECT_TIMEOUT", 10).to_i
  @transport = ENV.fetch("OPENCLAW_TRANSPORT", "auto")
end

Instance Attribute Details

#max_retriesObject

Max retries for transient failures



11
12
13
# File 'lib/collavre_openclaw/configuration.rb', line 11

def max_retries
  @max_retries
end

#open_timeoutObject

Connection timeout (seconds) - how long to wait for connection



4
5
6
# File 'lib/collavre_openclaw/configuration.rb', line 4

def open_timeout
  @open_timeout
end

#read_timeoutObject

Read timeout (seconds) - how long to wait for streaming response AI responses can take 60-180+ seconds with reasoning/tools



8
9
10
# File 'lib/collavre_openclaw/configuration.rb', line 8

def read_timeout
  @read_timeout
end

#transportObject

Transport mode: “auto” (WebSocket first, HTTP fallback), “http” (HTTP only)



26
27
28
# File 'lib/collavre_openclaw/configuration.rb', line 26

def transport
  @transport
end

#ws_connect_timeoutObject

WebSocket connect timeout (seconds)



23
24
25
# File 'lib/collavre_openclaw/configuration.rb', line 23

def ws_connect_timeout
  @ws_connect_timeout
end

#ws_idle_timeoutObject

WebSocket idle timeout (seconds) - disconnect after inactivity



14
15
16
# File 'lib/collavre_openclaw/configuration.rb', line 14

def ws_idle_timeout
  @ws_idle_timeout
end

#ws_reconnect_base_delayObject

WebSocket reconnect base delay (seconds) - exponential backoff base



20
21
22
# File 'lib/collavre_openclaw/configuration.rb', line 20

def ws_reconnect_base_delay
  @ws_reconnect_base_delay
end

#ws_reconnect_maxObject

WebSocket max reconnect attempts before giving up



17
18
19
# File 'lib/collavre_openclaw/configuration.rb', line 17

def ws_reconnect_max
  @ws_reconnect_max
end

Instance Method Details

#request_timeoutObject

Legacy accessor for backward compatibility



44
45
46
# File 'lib/collavre_openclaw/configuration.rb', line 44

def request_timeout
  @read_timeout
end

#request_timeout=(value) ⇒ Object



48
49
50
# File 'lib/collavre_openclaw/configuration.rb', line 48

def request_timeout=(value)
  @read_timeout = value
end