legion-llm 0.9.33 → 0.9.34

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: 768503fd466d914e0cc3f4bb713ac0a710b392ebc0098eab5d6c2def05f5f9f5
4
- data.tar.gz: 9b0823a06222164a83123d0b895c701da3415aee51bca8b8ab303e6f1b72a532
3
+ metadata.gz: ca7cfa8bdb01bbb162989ba4ce84f8735eb46e34f36cfea29d4504357d6eaa38
4
+ data.tar.gz: 2b8866db7f799f242a070fa590c18f64cbee278c7fc2e827a9fe604cab6ce7d1
5
5
  SHA512:
6
- metadata.gz: 8b85a0b079619ed107b79044b6cfaa29f58a11881cd67a883cc2d107efebbf19240241d892daf983abd89876391fb3152434da27ce7e3a043f9170bde75d747e
7
- data.tar.gz: 3c64a0f8744c10882cf02510480dd9757c68053454dabfd639340b16561f8640011fba2d4cb120d32c4ee532ac497db10167c516656562f722aa415f2800e49a
6
+ metadata.gz: 2b3ba4cb577aa0a44b166ef7ee1299db98b5dbfa3759f76fb158ffa5e2c4eca7999198f47d87e70d8ebf79f21e1395137e75f26b033f609b939f70b2faa0b1f6
7
+ data.tar.gz: c77913f743c3075977419811d8c20fe7d7c1b48b77cc234b1bdcd4e1c1642734c9f203c60f3d8ec0c021f9cffe9fc79fd18a0abc14f452bdd152175d8a7fe820
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Legion LLM Changelog
2
2
 
3
+ ## [0.9.34] - 2026-05-22
4
+
5
+ ### Fixed
6
+ - API: `extract_token` now correctly reads `:input_tokens` / `:output_tokens` hash keys from `pipeline_response.tokens`, fixing `input_tokens: 0` in streaming `response.completed` events (caused Codex CLI `stream disconnected before completion` error)
7
+
3
8
  ## [0.9.33] - 2026-05-22
4
9
 
5
10
  ### Added
@@ -257,9 +257,14 @@ module Legion
257
257
 
258
258
  def self.extract_token(tokens, key)
259
259
  return 0 if tokens.nil?
260
- return (tokens[key] || tokens[key.to_s] || 0).to_i if tokens.is_a?(Hash)
261
260
 
262
261
  method_name = { input: :input_tokens, output: :output_tokens }[key]
262
+
263
+ if tokens.is_a?(Hash)
264
+ return (tokens[method_name] || tokens[method_name.to_s] ||
265
+ tokens[key] || tokens[key.to_s] || 0).to_i
266
+ end
267
+
263
268
  return tokens.public_send(method_name).to_i if method_name && tokens.respond_to?(method_name)
264
269
 
265
270
  0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module LLM
5
- VERSION = '0.9.33'
5
+ VERSION = '0.9.34'
6
6
  end
7
7
  end
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.9.33
4
+ version: 0.9.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity