Class: Legion::Extensions::Llm::Bedrock::Actor::DiscoveryRefresh

Inherits:
Actors::Every
  • Object
show all
Includes:
Helpers::Lex, DiscoveryCapabilityEvidenceHelpers, DiscoveryHealthHelpers, DiscoveryModelHelpers, DiscoveryOperationEvidenceHelpers, DiscoveryOrchestrationHelpers, DiscoveryProbeHelpers, Logging::Helper
Defined in:
lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb

Overview

SSOT v3 periodic discovery actor for Bedrock provider instances. Claims instances under the operator's CONFIG NAME (the InstanceKey.instance_id the router keys settings lookups by), carries the derived region/credential id as the secondary InstanceKey.physical_id (dedup/diagnostics only), discovers models via ListFoundationModels, probes health via the same non-inference control-plane call, and publishes complete OfferingDraft snapshots through Inventory::Publisher. Supports coalesced reactive probes after dispatch-triggered instance_unavailable transitions, re-activation of instances stuck in :initializing after a transient startup failure, and per-tick reconciliation of the instance set.

Constant Summary collapse

DEFAULT_DISCOVERY_INTERVAL_SECONDS =

Mirrors the registered lex-llm default (discovery.interval_seconds); used only when the settings tree has no discovery section. time must never return nil — a TimerTask with a nil interval fires exactly once and stops.

300

Constants included from DiscoveryOrchestrationHelpers

Legion::Extensions::Llm::Bedrock::Actor::DiscoveryOrchestrationHelpers::SCALAR_EVIDENCE_FIELDS

Constants included from DiscoveryCapabilityEvidenceHelpers

Legion::Extensions::Llm::Bedrock::Actor::DiscoveryCapabilityEvidenceHelpers::CONTEXT_WINDOWS

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


904
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 904

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


905
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 905

def generate_task?  = false

#manualObject



912
913
914
915
916
917
918
919
920
921
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 912

def manual
  if @initialized
    tick_refresh
  else
    initial_discovery
    @initialized = true
  end
rescue StandardError => e
  handle_exception(e, level: :warn, operation: 'bedrock.actor.discovery_refresh')
end

#run_now?Boolean

Returns:

  • (Boolean)


902
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 902

def run_now?        = true

#runner_classObject



900
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 900

def runner_class    = self.class

#runner_functionObject



901
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 901

def runner_function = 'manual'

#shutdownObject



923
924
925
926
927
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 923

def shutdown
  remove_all_instances
rescue StandardError => e
  handle_exception(e, level: :warn, operation: 'bedrock.actor.discovery_refresh.shutdown')
end

#timeObject



907
908
909
910
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 907

def time
  interval = settings.dig(:discovery, :interval_seconds)
  interval.is_a?(Integer) && interval.positive? ? interval : DEFAULT_DISCOVERY_INTERVAL_SECONDS
end

#use_runner?Boolean

Returns:

  • (Boolean)


903
# File 'lib/legion/extensions/llm/bedrock/actors/discovery_refresh.rb', line 903

def use_runner?     = false