lex-llm-anthropic 0.2.12 → 0.2.13

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: 4f3196e6fe3ab6df1b6f1b06be9a71f317d22f3e37e32dc39515b5e392aa292f
4
- data.tar.gz: d7e63aea83f71e31f4a4a4b9881ba331267d2dbc1a6378b737c78f72cc8edc56
3
+ metadata.gz: 7ea542d2f08da7b03e8f42e683dca5638bdaf07966f3389cdfcccfa22f8581b0
4
+ data.tar.gz: b0e902241e5dd1c94c3742f9cee76d4aa2a41516829ce5c481084e70378826cc
5
5
  SHA512:
6
- metadata.gz: 7e83d533b933209dadb0ad6badfc6e03d546ca64e737189094440544eace90ff392ae9262990e81d36684bc37b43b7db586dd8d8b57ea2b512a4cd3124558303
7
- data.tar.gz: f78eb6154a3f2a626c64231fc2bf6b36c7dac63fffc4e362e6aa670de5ad40fcc6af4ce29b225e1d73222b8647ef26fa537d25aed3370c6ab40a79ec5f143d8e
6
+ metadata.gz: 333cff908f11b23fe522c2bb79743d879b5adf0d7ce952e0b989becb9da775b58a528ba7f52ec42b7f7ef188d4d7b3db29db9700df4b17e0435c0e4de0087b1c
7
+ data.tar.gz: 57ad771fb6b041d74e1459bb46e5cd471f8f37f416b014bcc6873f97aca3fe0aea74c7a943ddfb3d8418bbf6ade69a0cda8fa6cc755134df53eabf9abeaaf1f1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.13 - 2026-06-02
4
+
5
+ - **Fix invalid anthropic-version header** — Default `api_version` was `'2023-10-02'` (typo), which Anthropic rejects. Changed to `'2023-10-16'` (anthropic.rb)
6
+ - **Add per-provider discovery refresh actor** — New `actors/discovery_refresh.rb` that only refreshes Anthropic models, avoiding coupling to other providers' discovery cycles
7
+
3
8
  ## 0.2.12 - 2026-06-01
4
9
 
5
10
  - Add `cache_control` markers to Anthropic Messages API requests for prompt caching
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'legion/extensions/actors/every'
5
+ rescue LoadError => e
6
+ warn(e.message) if $VERBOSE
7
+ end
8
+
9
+ return unless defined?(Legion::Extensions::Actors::Every)
10
+
11
+ module Legion
12
+ module Extensions
13
+ module Llm
14
+ module Anthropic
15
+ module Actor
16
+ class DiscoveryRefresh < Legion::Extensions::Actors::Every # rubocop:disable Style/Documentation
17
+ include Legion::Logging::Helper
18
+
19
+ REFRESH_INTERVAL = 1800
20
+
21
+ def runner_class = self.class
22
+ def runner_function = 'manual'
23
+ def run_now? = true
24
+ def use_runner? = false
25
+ def check_subtask? = false
26
+ def generate_task? = false
27
+
28
+ def time
29
+ return REFRESH_INTERVAL unless defined?(Legion::Settings)
30
+
31
+ Legion::Settings.dig(:extensions, :llm, :anthropic, :discovery_interval) || REFRESH_INTERVAL
32
+ end
33
+
34
+ def manual
35
+ log.debug('[anthropic][discovery_refresh] refreshing model list')
36
+ return unless defined?(Legion::LLM::Discovery)
37
+
38
+ Legion::LLM::Discovery.refresh_discovered_models!(provider: :anthropic)
39
+ rescue StandardError => e
40
+ handle_exception(e, level: :warn, handled: true, operation: 'anthropic.actor.discovery_refresh')
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -46,7 +46,7 @@ module Legion
46
46
  def headers
47
47
  identity_headers.merge({
48
48
  'x-api-key' => config.anthropic_api_key,
49
- 'anthropic-version' => config.anthropic_version || settings[:api_version] || '2023-10-02'
49
+ 'anthropic-version' => config.anthropic_version || settings[:api_version] || '2023-06-01'
50
50
  }.compact)
51
51
  end
52
52
 
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Llm
6
6
  module Anthropic
7
- VERSION = '0.2.12'
7
+ VERSION = '0.2.13'
8
8
  end
9
9
  end
10
10
  end
@@ -24,7 +24,7 @@ module Legion
24
24
  instance: {
25
25
  default_model: 'claude-sonnet-4-6',
26
26
  endpoint: 'https://api.anthropic.com',
27
- api_version: '2023-10-02',
27
+ api_version: '2023-10-16',
28
28
  default_max_tokens: 4096,
29
29
  tier: :frontier,
30
30
  transport: :http,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-llm-anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - LegionIO
@@ -97,6 +97,7 @@ files:
97
97
  - README.md
98
98
  - lex-llm-anthropic.gemspec
99
99
  - lib/legion/extensions/llm/anthropic.rb
100
+ - lib/legion/extensions/llm/anthropic/actors/discovery_refresh.rb
100
101
  - lib/legion/extensions/llm/anthropic/actors/fleet_worker.rb
101
102
  - lib/legion/extensions/llm/anthropic/provider.rb
102
103
  - lib/legion/extensions/llm/anthropic/registry_event_builder.rb