aireview 0.2.0 → 0.2.1

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: b27b5c59888ddb35675082d95d7e5e79dc1935295ecde9a1e13cdcaf38f24dff
4
- data.tar.gz: 6016c5aae6d57475465c707cc2d89dedf07964d402cc1f5a68a6e01dc5f553d1
3
+ metadata.gz: 6f428bec4ae96692e65cd9f219856dff87e04e75dec45448dc9ef6806dd6694a
4
+ data.tar.gz: 515afe0ed7450df6cfcb2ce12040780a9c0f45bbbc45fef08f19c4601239908b
5
5
  SHA512:
6
- metadata.gz: bc47e9e8d2c7cece68a02a92594c896f52c5b101c8a639cee9f3c702e010906e5280dbda4282465630162c90b2532debcdca05462c8a1b390987288b150850dc
7
- data.tar.gz: 644ad90865170c254b3b844e606f9c0121a2b82a50d7af62ffd70f4bf838bd0a258db367e3a815d899fb8bb628f183d268eee11722d2364bf700734ba463b7a3
6
+ metadata.gz: 97cf66d34a0dee0d02823a3d37ad37b85aefeb4a0e2b997cd9f8c0780c3df9816d7c95f520709d3cc668d3910bf749f26553da2001b0878c0935bf117b6a486d
7
+ data.tar.gz: c9ede525f15c46b1ce3371c7a77394933599bc71c6900f79dcea5a6780a29621378e7cd6d5652480921cefe84e6513c4865bd81265523fb6436752f9b35a422d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ - An overloaded LLM (503) gets a fifth attempt: the pauses are now about
6
+ 2, 5, 5 and 5 minutes. Rate limits and network errors keep their three
7
+ retries.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  - Context budget: `llm.max_prompt_chars` caps the request of each stage,
data/README.md CHANGED
@@ -163,8 +163,8 @@ address with `/v1` matches the
163
163
  [Ollama configuration in RubyLLM](https://rubyllm.com/configuration/#provider-configuration).
164
164
  `LLM_TIMEOUT` sets the timeout of every LLM request in seconds; for a slow
165
165
  local model it can be raised. It does not apply to an "overloaded" (503)
166
- answer from the provider: such a request gets up to four attempts, the
167
- original one and three retries with pauses of about 2, 5 and 5 minutes, and
166
+ answer from the provider: such a request gets up to five attempts, the
167
+ original one and four retries with pauses of about 2, 5, 5 and 5 minutes, and
168
168
  only the failed stage is repeated, not the whole run.
169
169
 
170
170
  Project rules live in `.aireview.yml`. In YAML the `generate.model` and
@@ -373,8 +373,8 @@ aireview:
373
373
  ```
374
374
 
375
375
  `timeout: 45m` is a chosen ceiling, not a guarantee that every retry fits in:
376
- when the provider is overloaded, one stage can wait up to ~14 minutes of
377
- pauses plus up to four requests of `LLM_TIMEOUT` each, and there are two
376
+ when the provider is overloaded, one stage can wait up to ~20 minutes of
377
+ pauses plus up to five requests of `LLM_TIMEOUT` each, and there are two
378
378
  stages.
379
379
 
380
380
  Set secrets such as `GITLAB_TOKEN`, `GEMINI_API_KEY` and the optional Jira
@@ -10,7 +10,7 @@ module Aireview
10
10
  TRANSIENT_RETRY_BASE_DELAY = 2.0
11
11
  TRANSIENT_RETRY_JITTER_RANGE = 2.0..5.0
12
12
  PROVIDER_RETRY_DELAY_MULTIPLIER_RANGE = 2.0..2.4
13
- OVERLOADED_RETRY_DELAYS = [120.0, 300.0, 300.0].freeze
13
+ OVERLOADED_RETRY_DELAYS = [120.0, 300.0, 300.0, 300.0].freeze
14
14
  OVERLOADED_RETRY_JITTER_RANGE = 0.85..1.15
15
15
  RETRY_WAIT_LOG_FORMAT = 'LLM %<stage>s request will sleep %<delay>.1fs before retry%<source>s ' \
16
16
  '(attempt %<next_attempt>d/%<max_attempts>d, model=%<model>s)'
@@ -126,7 +126,13 @@ module Aireview
126
126
  end
127
127
 
128
128
  def retry_llm_request?(error, attempt)
129
- transient_llm_error?(error) && attempt <= MAX_TRANSIENT_RETRIES
129
+ transient_llm_error?(error) && attempt <= max_retries(error)
130
+ end
131
+
132
+ # Перегруженному провайдеру даётся на один повтор больше: 503 у Gemini
133
+ # держится дольше, чем rate limit или сетевой сбой.
134
+ def max_retries(error)
135
+ overloaded_llm_error?(error) ? OVERLOADED_RETRY_DELAYS.size : MAX_TRANSIENT_RETRIES
130
136
  end
131
137
 
132
138
  def wait_before_retry(error:, attempt:, stage:, model:)
@@ -138,7 +144,7 @@ module Aireview
138
144
  delay: retry_delay[:delay],
139
145
  source: retry_delay_source(retry_delay),
140
146
  next_attempt: attempt + 1,
141
- max_attempts: MAX_TRANSIENT_RETRIES + 1,
147
+ max_attempts: max_retries(error) + 1,
142
148
  model: model
143
149
  )
144
150
  )
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Aireview
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aireview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Levenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-12 00:00:00.000000000 Z
11
+ date: 2026-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv