lex-llm-ledger 0.4.0 → 0.4.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d96639d6f6bf123c338c0df58c4e25d1375d0102873318197f6297eeda70a80
|
|
4
|
+
data.tar.gz: 1ebcbc88558e3783595e3c07c13eb0f9d0f3fbb82a2c096cb52752592c469d2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 670f7c45555f557aae91ba858831f1ce40e74eaf92a5390a965e2d5e6487a6b6deb9700527a6098bd8454b2085fbe1de567195d4a7f54b8f910921d6dde9535f
|
|
7
|
+
data.tar.gz: a72b7dac0f47bf49ca637f060698899d8eb2fc1d7436e2271afbddb8ef5684a00e5b75ae264ac6d635bc9ac58b9e79fab84070b4b51878324615d939942a9ef7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.2] - 2026-05-22
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Dead-letter tool audit messages with missing parent response rows via `UnrecoverableMessageError` so the subscription rejects the RabbitMQ delivery with `requeue: false` instead of acknowledging, republishing, or blocking inside a runner-local sleep/retry loop.
|
|
7
|
+
- Set the `llm.registry.availability` subscription actor prefetch to 4 so registry availability events can drain with modest concurrency.
|
|
8
|
+
|
|
9
|
+
## [0.4.1] - 2026-05-18
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Tool write retries once after 1s when parent response row is not yet committed (race between async metering publish and tool audit AMQP delivery)
|
|
13
|
+
- Raises `ResponseNotReady` instead of silently returning nil when response row is missing
|
|
14
|
+
|
|
15
|
+
|
|
3
16
|
## [0.4.0] - 2026-05-17
|
|
4
17
|
|
|
5
18
|
### Changed
|
|
@@ -10,6 +10,8 @@ module Legion
|
|
|
10
10
|
module Extensions
|
|
11
11
|
module Llm
|
|
12
12
|
module Ledger
|
|
13
|
+
class ResponseNotReady < StandardError; end
|
|
14
|
+
|
|
13
15
|
module Runners
|
|
14
16
|
module Tools
|
|
15
17
|
extend self
|
|
@@ -51,6 +53,9 @@ module Legion
|
|
|
51
53
|
rescue Helpers::DecryptionFailed => e
|
|
52
54
|
handle_exception(e, level: :error, handled: true, operation: 'write_tool_record.decrypt')
|
|
53
55
|
raise
|
|
56
|
+
rescue ResponseNotReady => e
|
|
57
|
+
log.warn("[ledger] write_tool_record: parent response not yet written, dead-lettering message (#{e.message})")
|
|
58
|
+
raise unrecoverable_message_error(e)
|
|
54
59
|
rescue StandardError => e
|
|
55
60
|
handle_exception(e, level: :error, handled: true, operation: 'write_tool_record')
|
|
56
61
|
{ result: :error, error: e.message }
|
|
@@ -62,6 +67,14 @@ module Legion
|
|
|
62
67
|
Helpers::SubscriptionMessage.runner_args(payload, metadata, message)
|
|
63
68
|
end
|
|
64
69
|
|
|
70
|
+
def unrecoverable_message_error(error)
|
|
71
|
+
if defined?(Legion::Extensions::Actors::UnrecoverableMessageError)
|
|
72
|
+
Legion::Extensions::Actors::UnrecoverableMessageError.new(error.message)
|
|
73
|
+
else
|
|
74
|
+
error
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
65
78
|
# Resolve the llm_message_inference_responses row this tool call belongs to.
|
|
66
79
|
# Returns nil if we cannot link at all.
|
|
67
80
|
def find_or_resolve_response(db, body, ctx, props, headers)
|
|
@@ -122,8 +135,7 @@ module Legion
|
|
|
122
135
|
fallback = fallback_response_for_conversation(db, body, ctx, headers)
|
|
123
136
|
return fallback[:id] if fallback # rubocop:disable Legion/Extension/RunnerReturnHash
|
|
124
137
|
|
|
125
|
-
|
|
126
|
-
nil
|
|
138
|
+
raise ResponseNotReady, "no response row found for tool call uuid=#{tool_uuid}"
|
|
127
139
|
end
|
|
128
140
|
|
|
129
141
|
def fallback_response_for_conversation(db, body, ctx, headers)
|