acpmux: host place puts Freestyle lane hosts before GCP (placement_preference)

Merged
TE
5d ago
+160-8

Leo, 2026-10-31: "WHY GCP IF WE HAVE FREESTYLE???" ... "FREESTYLE" "I ALREADY SAID THIS".

acpmux host place, and new --host auto / dispatch --host auto (same pick), now prefer Freestyle lane hosts over GCP lane hosts, the way leo-workspace's lane-place already does.

What changed (cmux-tui/crates/acpmux/src/placement.rs)

  • Reads fleet-registry lane_place.placement_preference: a list best first of providers (freestyle, gcp) and registry machine names.
  • A host's tier is its own name's place in that list, else its provider's: the machine's provider when declared, else freestyle for an agent_vm with a cloud block, else gcp for a gcp block or a gcp- name (lane-place's host_provider).
  • Only a host that takes the work and has room for a lane gets a tier (lane-place's "headroom"). Among those, the earlier tier wins before room is compared; hosts in no tier come after. Room, refusal, build and overloaded logic are unchanged.
  • A missing or malformed list (not a list of distinct providers or machine names) gives no tiers, so the order is the same as before.
  • The tier shows in the pick's why (..., tier 1 (freestyle, lane_place.placement_preference)) and in --json (top-level tier and per-host tier, {index, of}, 1 best).

Tests (placement_tests.rs)

  • A Freestyle VM with room beats a less-loaded GCP VM; a gcp- VM with no gcp block counts as GCP; a host named in the list takes that tier.
  • A full Freestyle VM (at its lane cap) loses to a GCP VM with room.
  • No placement_preference, or a malformed one, keeps the most-room order.

Risk: small, one function's ordering plus output fields. Hosts' refusal and the overloaded fallback are untouched.

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

acpmux host place now prefers Freestyle lane hosts over GCP hosts, matching leo-workspace's lane-place.

  • Reads the registry's lane_place.placement_preference, a best-first list of providers and machine names; hosts in no tier come after tiered ones.
  • Only hosts with room for a lane get a tier, and the tier appears in the pick's why and --json as {index, of}.
  • A missing or malformed preference list keeps the previous most-room order.
  • Tests cover a Freestyle VM beating a less-loaded GCP VM, a full Freestyle VM losing to GCP with room, and malformed lists keeping the old order.