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

Inherits:
Actors::Every
  • Object
show all
Includes:
EvidenceBuilding, HealthDisplay, HealthProbing, HttpConnections, InstanceConfig, OfferingAssembly, TickCycle, ValueEvidenceBuilding, 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 EvidenceBuilding

EvidenceBuilding::EMBEDDING_PATTERN, EvidenceBuilding::UNKNOWN_EVIDENCE_SRC

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


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

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


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

def generate_task?  = false

#manualObject



648
649
650
651
652
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 648

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

#run_now?Boolean

Returns:

  • (Boolean)


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

def run_now?        = true

#runner_classObject



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

def runner_class    = self.class

#runner_functionObject



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

def runner_function = 'manual'

#shutdownObject



654
655
656
657
658
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 654

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

#timeObject



643
644
645
646
# File 'lib/legion/extensions/llm/mlx/actors/discovery_refresh.rb', line 643

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)


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

def use_runner?     = false