Class: Legion::Extensions::Llm::Vertex::Actor::DiscoveryRefresh

Inherits:
Actors::Every
  • Object
show all
Includes:
Helpers::Lex, DiscoveryRefreshCapabilityEvidence, DiscoveryRefreshClaimHelpers, DiscoveryRefreshConfigHelpers, DiscoveryRefreshHealthDisplay, DiscoveryRefreshLifecycleHelpers, DiscoveryRefreshOfferingHelpers, DiscoveryRefreshOperationEvidence, DiscoveryRefreshProbeHelpers, DiscoveryRefreshReactiveProbeHelpers, DiscoveryRefreshWeightPublication, Logging::Helper
Defined in:
lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb

Overview

SSOT v3 periodic discovery actor for Vertex AI provider instances. Claims configured instances, discovers models from the STATIC_MODELS catalog, probes health via the non-inference models-list endpoint, and publishes complete OfferingDraft snapshots through the Inventory::Publisher. Owns the refresh cadence, recovers initial-readiness failures, and writes the display-only health/capabilities settings after each registry commit.

Constant Summary collapse

FALLBACK_DISCOVERY_INTERVAL_SECONDS =

Guards a broken discovery config (missing or non-positive value); the registered default (lex-llm ProviderSettings) is 300 seconds.

300

Constants included from DiscoveryRefreshHealthDisplay

Legion::Extensions::Llm::Vertex::Actor::DiscoveryRefreshHealthDisplay::CAPABILITY_NAMES_BY_OPERATION, Legion::Extensions::Llm::Vertex::Actor::DiscoveryRefreshHealthDisplay::HEALTH_ADJUSTMENT_AVAILABLE, Legion::Extensions::Llm::Vertex::Actor::DiscoveryRefreshHealthDisplay::HEALTH_ADJUSTMENT_DEGRADED

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


761
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 761

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


762
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 762

def generate_task?  = false

#manualObject



772
773
774
775
776
777
778
779
780
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 772

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

#run_now?Boolean

Returns:

  • (Boolean)


759
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 759

def run_now?        = true

#runner_classObject



757
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 757

def runner_class    = self.class

#runner_functionObject



758
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 758

def runner_function = 'manual'

#shutdownObject



782
783
784
785
786
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 782

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

#timeObject

The actor owns the discovery cadence. Read the registered interval so the operator knob is honored and the timer never receives nil.



767
768
769
770
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 767

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

#use_runner?Boolean

Returns:

  • (Boolean)


760
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 760

def use_runner?     = false