legion-llm 0.5.1 → 0.5.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: b90743ee0a2a33c40d2e6937543f4ca0acc13a8b8caaa29efbe21f496e62caf9
4
- data.tar.gz: e73321ef190bdfb13fb972a826f88ef5229bfe7e98dfe9da7081d1d617eb1438
3
+ metadata.gz: 80076d5e95e5472a4bef6e55e259cfff51d1ceb34a088cd7cac52bd4de334594
4
+ data.tar.gz: 961d9400935b34062035ee7e3116cff815b906d4438db7185a0db7808546ec87
5
5
  SHA512:
6
- metadata.gz: af7f9cb12815fae3140f43da3bff45c61e003d63f5792b7977743a599ce95edeb4252b840b0a59fcab56b47cbc6d42c28d3d1478edf8e850f9dddcc9bfbd19e0
7
- data.tar.gz: 48202fcb37e5e931f5a723ccd424e36f1425d1f90efdc46ff97910990677a6711cc93e7256be7fa72769a924f5387aa72164209980d22859affe39e87bc2fa7e
6
+ metadata.gz: c63df0d39c4a0e904e7fb7e38bfa7511b37ddac7416c356e4da229c2b36ee699956849ae7e16b978d30665bc75491e918988aa820f36c17cc6ef8056b65226fc
7
+ data.tar.gz: 2eb7df17162660933aaf9648b15c99c33b0a86a1182675ebf5ac1129ee0a3413311d0b9e148b38e69fa98111ca66a8bbf2a17392b8042cd640f00659517592dd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Legion LLM Changelog
2
2
 
3
+ ## [0.5.2] - 2026-03-24
4
+
5
+ ### Changed
6
+ - Add debug logging to 10 swallowed `rescue StandardError` blocks: `pipeline_enabled?`, ConversationStore (load_from_db, db_conversation_exists?, db_available?), BudgetGuard (budget_setting), ReplyDispatcher (parse_payload), OverrideConfidence (sync_to_l1, sync_to_l2, lookup_l1, lookup_l2)
7
+
3
8
  ## [0.5.1] - 2026-03-24
4
9
 
5
10
  ### Fixed
@@ -94,7 +94,8 @@ module Legion
94
94
  return [] unless db_available?
95
95
 
96
96
  db_load_messages(conversation_id)
97
- rescue StandardError
97
+ rescue StandardError => e
98
+ Legion::Logging.debug("ConversationStore#load_from_db failed: #{e.message}") if defined?(Legion::Logging)
98
99
  []
99
100
  end
100
101
 
@@ -102,7 +103,8 @@ module Legion
102
103
  return false unless db_available?
103
104
 
104
105
  db_conversation_record?(conversation_id)
105
- rescue StandardError
106
+ rescue StandardError => e
107
+ Legion::Logging.debug("ConversationStore#db_conversation_exists? failed: #{e.message}") if defined?(Legion::Logging)
106
108
  false
107
109
  end
108
110
 
@@ -111,7 +113,8 @@ module Legion
111
113
  Legion::Data.respond_to?(:connection) &&
112
114
  Legion::Data.connection.respond_to?(:table_exists?) &&
113
115
  Legion::Data.connection.table_exists?(:conversations)
114
- rescue StandardError
116
+ rescue StandardError => e
117
+ Legion::Logging.debug("ConversationStore#db_available? failed: #{e.message}") if defined?(Legion::Logging)
115
118
  false
116
119
  end
117
120
 
@@ -89,7 +89,8 @@ module Legion
89
89
  require 'json'
90
90
  ::JSON.parse(raw, symbolize_names: true)
91
91
  end
92
- rescue StandardError
92
+ rescue StandardError => e
93
+ Legion::Logging.debug("ReplyDispatcher#parse_payload failed: #{e.message}") if defined?(Legion::Logging)
93
94
  {}
94
95
  end
95
96
  end
@@ -72,7 +72,8 @@ module Legion
72
72
 
73
73
  settings = Legion::Settings.dig(:llm, :budget, :session_usd)
74
74
  settings.to_f
75
- rescue StandardError
75
+ rescue StandardError => e
76
+ Legion::Logging.debug("BudgetGuard#budget_setting failed: #{e.message}") if defined?(Legion::Logging)
76
77
  0.0
77
78
  end
78
79
  end
@@ -130,7 +130,8 @@ module Legion
130
130
  return unless entry
131
131
 
132
132
  Legion::Cache.set("override:#{tool}", Legion::JSON.dump(entry), ttl: 3600)
133
- rescue StandardError
133
+ rescue StandardError => e
134
+ Legion::Logging.debug("OverrideConfidence#sync_to_l1 failed: #{e.message}") if defined?(Legion::Logging)
134
135
  nil
135
136
  end
136
137
 
@@ -141,7 +142,8 @@ module Legion
141
142
  return unless entry
142
143
 
143
144
  Legion::Data::Local.upsert(:override_confidence, entry, conflict_keys: [:tool])
144
- rescue StandardError
145
+ rescue StandardError => e
146
+ Legion::Logging.debug("OverrideConfidence#sync_to_l2 failed: #{e.message}") if defined?(Legion::Logging)
145
147
  nil
146
148
  end
147
149
 
@@ -152,7 +154,8 @@ module Legion
152
154
  return nil unless raw
153
155
 
154
156
  Legion::JSON.load(raw)
155
- rescue StandardError
157
+ rescue StandardError => e
158
+ Legion::Logging.debug("OverrideConfidence#lookup_l1 failed: #{e.message}") if defined?(Legion::Logging)
156
159
  nil
157
160
  end
158
161
 
@@ -161,7 +164,8 @@ module Legion
161
164
 
162
165
  rows = Legion::Data::Local.query('SELECT * FROM override_confidence WHERE tool = ?', tool)
163
166
  rows&.first
164
- rescue StandardError
167
+ rescue StandardError => e
168
+ Legion::Logging.debug("OverrideConfidence#lookup_l2 failed: #{e.message}") if defined?(Legion::Logging)
165
169
  nil
166
170
  end
167
171
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module LLM
5
- VERSION = '0.5.1'
5
+ VERSION = '0.5.2'
6
6
  end
7
7
  end
data/lib/legion/llm.rb CHANGED
@@ -202,7 +202,8 @@ module Legion
202
202
 
203
203
  def pipeline_enabled?
204
204
  settings[:pipeline_enabled] == true
205
- rescue StandardError
205
+ rescue StandardError => e
206
+ Legion::Logging.debug("LLM#pipeline_enabled? failed: #{e.message}") if defined?(Legion::Logging)
206
207
  false
207
208
  end
208
209
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity