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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +4 -4
- data/lib/aireview/reviewer.rb +9 -3
- data/lib/aireview/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f428bec4ae96692e65cd9f219856dff87e04e75dec45448dc9ef6806dd6694a
|
|
4
|
+
data.tar.gz: 515afe0ed7450df6cfcb2ce12040780a9c0f45bbbc45fef08f19c4601239908b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
167
|
-
original one 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 ~
|
|
377
|
-
pauses plus up to
|
|
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
|
data/lib/aireview/reviewer.rb
CHANGED
|
@@ -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 <=
|
|
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:
|
|
147
|
+
max_attempts: max_retries(error) + 1,
|
|
142
148
|
model: model
|
|
143
149
|
)
|
|
144
150
|
)
|
data/lib/aireview/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2026-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|