miniswen 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/miniswen/agent.rb +1 -1
- data/lib/miniswen/local.rb +3 -1
- data/lib/miniswen/ruby_llm.rb +9 -8
- data/lib/miniswen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9dcf80689f2e298f334350c181a91372967140d43f7f165832c69311226437ea
|
|
4
|
+
data.tar.gz: 95460fe301c6e8a112dc27e0d4433a0b43998f74d6930943cc8823adbc3e79cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3da1895808b25d679099dbf528ec634cdaf81177c70acd959b7be8653288ee862c18314449fc6d343ead5d59bfbb13a703b1ba59e2341b0dcf85b2a3dca8bdfe
|
|
7
|
+
data.tar.gz: 975caedb5731b91490fbf6bd1b193103ca438afde7b6cda0f809377a98bfdfd6f76b32d2d2ee1b87696747e13d2600362bcc04d92de8c018969ac6c73ea45ee4
|
data/lib/miniswen/agent.rb
CHANGED
|
@@ -513,7 +513,7 @@ module Miniswen
|
|
|
513
513
|
body = e.response&.body.to_s
|
|
514
514
|
detail = body.empty? ? e.message : "#{e.message}: #{body[0, 1000]}"
|
|
515
515
|
raise InfrastructureError, "miniswen: the model call failed: #{detail}"
|
|
516
|
-
rescue Faraday::SSLError, Faraday::ConnectionFailed, Faraday::TimeoutError => e
|
|
516
|
+
rescue Faraday::SSLError, Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::ParsingError => e
|
|
517
517
|
raise InfrastructureError, "miniswen: the model call failed: #{e.class}: #{e.message}"
|
|
518
518
|
end
|
|
519
519
|
|
data/lib/miniswen/local.rb
CHANGED
|
@@ -9,8 +9,10 @@ module Miniswen
|
|
|
9
9
|
class Local < Environment
|
|
10
10
|
TIMEOUT_EXIT_CODE = 124
|
|
11
11
|
|
|
12
|
+
# Always through a shell: Ruby execs a metacharacter-free string directly,
|
|
13
|
+
# and a missing binary would then raise ENOENT here instead of exiting 127.
|
|
12
14
|
def exec(command, timeout: nil, env: nil)
|
|
13
|
-
Open3.popen2e(env || {}, command, pgroup: true) do |stdin, io, wait_thr|
|
|
15
|
+
Open3.popen2e(env || {}, "sh", "-c", command, pgroup: true) do |stdin, io, wait_thr|
|
|
14
16
|
stdin.close
|
|
15
17
|
reader = Thread.new { io.read }
|
|
16
18
|
|
data/lib/miniswen/ruby_llm.rb
CHANGED
|
@@ -8,9 +8,10 @@ RubyLLM.configure do |config|
|
|
|
8
8
|
config.logger = Logger.new(IO::NULL) unless ENV["MINISWEN_DEBUG"] == "1"
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# About five minutes of retries (1, 2, 4, ... 128s plus jitter): provider
|
|
12
|
+
# outages and rate-limit windows outlast the minute this used to allow.
|
|
12
13
|
RubyLLM.configure do |config|
|
|
13
|
-
config.max_retries =
|
|
14
|
+
config.max_retries = 8
|
|
14
15
|
config.retry_interval = 1
|
|
15
16
|
end
|
|
16
17
|
|
|
@@ -36,13 +37,13 @@ module Miniswen
|
|
|
36
37
|
end
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
module
|
|
43
|
-
def retry_exceptions = super + [ Faraday::SSLError ]
|
|
40
|
+
# ruby_llm lists SSL errors as fatal, but a handshake reset never sent the
|
|
41
|
+
# request; a 200 with a truncated JSON body is the same dropped connection
|
|
42
|
+
# one step later.
|
|
43
|
+
module RetryTransientFailures
|
|
44
|
+
def retry_exceptions = super + [ Faraday::SSLError, Faraday::ParsingError ]
|
|
44
45
|
end
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
RubyLLM::Providers::OpenRouter.prepend(Miniswen::VerbatimReasoningDetails)
|
|
48
|
-
RubyLLM::Connection.prepend(Miniswen::
|
|
49
|
+
RubyLLM::Connection.prepend(Miniswen::RetryTransientFailures)
|
data/lib/miniswen/version.rb
CHANGED