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

Inherits:
Actors::Every
  • Object
show all
Includes:
Helpers::Lex, DiscoveryRefreshCapabilityEvidence, DiscoveryRefreshClaimHelpers, DiscoveryRefreshConfigHelpers, DiscoveryRefreshHealthDisplay, DiscoveryRefreshLifecycleHelpers, DiscoveryRefreshOfferingHelpers, DiscoveryRefreshOperationEvidence, DiscoveryRefreshProbeHelpers, 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)


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

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


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

def generate_task?  = false

#manualObject



626
627
628
629
630
631
632
633
634
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 626

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)


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

def run_now?        = true

#runner_classObject



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

def runner_class    = self.class

#runner_functionObject



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

def runner_function = 'manual'

#shutdownObject



636
637
638
639
640
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 636

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.



621
622
623
624
# File 'lib/legion/extensions/llm/vertex/actors/discovery_refresh.rb', line 621

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)


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

def use_runner?     = false