Skip to main content

resolve_runner

Function resolve_runner 

Source
pub fn resolve_runner(
    bp: &Blueprint,
    agent: &AgentDef,
) -> Result<Option<Runner>, RunnerResolveError>
Expand description

Resolve agent’s effective Runner against bp, in cascade order (highest priority first):

  1. agent.runner (inline declaration) — wins unconditionally.
  2. agent.runner_ref, resolved against bp.runners (an unresolved name is RunnerResolveError::UnknownRunnerRef).
  3. Legacy fallback (agent-level): agent.profile.worker_binding = Some(variant) becomes Runner::WsClaudeCode { variant, tools: profile.tools.clone() } — the same synthesis crate::service::task_launch::derive_worker_bindings (in the mlua-swarm core crate) performs at launch time today.
  4. bp.default_runner, resolved against bp.runners (an unresolved name is RunnerResolveError::UnknownDefaultRunner).
  5. Ok(None) — no Runner declared through any tier.

Legacy (agent-level) beats default_runner (BP-global): tier 3 outranks tier 4, the same “agent-level wins over BP-global” rule the ctx cascade (AgentInline > MetaRef > BpGlobal, see mlua-swarm’s core::explain::CtxTier) already follows.

Pure and read-only: this Milestone does not wire the result into the launch / compile path (Milestone 3 scope) — it only declares the resolver.