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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4c9e3b53432be806eb3a0822777bafd74b6656e5c3577e2b7a41f70f24f6a97
4
- data.tar.gz: a533f95356c1b8ba40606a25cc79f6e6da885fe42251daf436dcad62df6a273e
3
+ metadata.gz: 9dcf80689f2e298f334350c181a91372967140d43f7f165832c69311226437ea
4
+ data.tar.gz: 95460fe301c6e8a112dc27e0d4433a0b43998f74d6930943cc8823adbc3e79cb
5
5
  SHA512:
6
- metadata.gz: bf213b85fd14ef0ec93b94409361f490b82769f70b6d6fbef8917688a9510c29366f7825c0ecdf951824a42ed19a33a23530679c23108f852996486ffd5d92db
7
- data.tar.gz: a9328e4313ce9abbe5843368428f4e85752cc9690c00e6bfe8c68321e8c820ce1000996472c76aded6eef0fa988815c9a2a7348bc12bc953ea356f980184bd71
6
+ metadata.gz: 3da1895808b25d679099dbf528ec634cdaf81177c70acd959b7be8653288ee862c18314449fc6d343ead5d59bfbb13a703b1ba59e2341b0dcf85b2a3dca8bdfe
7
+ data.tar.gz: 975caedb5731b91490fbf6bd1b193103ca438afde7b6cda0f809377a98bfdfd6f76b32d2d2ee1b87696747e13d2600362bcc04d92de8c018969ac6c73ea45ee4
@@ -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
 
@@ -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
 
@@ -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
- # Increase retry window to handle egress network issues
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 = 3
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
- # A handshake reset never sent the request, so retrying is as safe as the
40
- # ConnectionFailed retries ruby_llm already does; it only lists SSL errors
41
- # as fatal.
42
- module RetryTransientSSL
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::RetryTransientSSL)
49
+ RubyLLM::Connection.prepend(Miniswen::RetryTransientFailures)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Miniswen
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miniswen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov