Class: Legion::Extensions::Llm::Mlx::Actor::DiscoveryRefresh

Inherits:
Actors::Every
  • Object
show all
Includes:
EvidenceBuilding, HealthDisplay, HealthProbing, HttpConnections, InstanceConfig, OfferingAssembly, OfferingComparison, TickCycle, ValueEvidenceBuilding, WeightPublication, Logging::Helper
Defined in:
lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb

Overview

SSOT v3 periodic discovery actor for MLX provider instances. Claims configured instances, discovers models via /v1/models, probes health via /health, and publishes complete OfferingDraft snapshots through the Inventory::Publisher. Supports coalesced reactive probes after dispatch-triggered instance_unavailable transitions.

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 HealthDisplay

HealthDisplay::HEALTH_SOURCE

Constants included from OfferingComparison

OfferingComparison::OFFERING_SCALAR_EVIDENCE_FIELDS

Constants included from EvidenceBuilding

EvidenceBuilding::EMBEDDING_PATTERN, EvidenceBuilding::UNKNOWN_EVIDENCE_SRC

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


783
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 783

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


784
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 784

def generate_task?  = false

#manualObject



791
792
793
794
795
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 791

def manual
  tick_refresh
rescue StandardError => e
  handle_exception(e, level: :warn, operation: 'mlx.actor.discovery_refresh')
end

#run_now?Boolean

Returns:

  • (Boolean)


781
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 781

def run_now?        = true

#runner_classObject



779
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 779

def runner_class    = self.class

#runner_functionObject



780
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 780

def runner_function = 'manual'

#shutdownObject



797
798
799
800
801
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 797

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

#timeObject



786
787
788
789
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 786

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)


782
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 782

def use_runner?     = false