acpmux: host place puts Freestyle lane hosts before GCP (placement_preference)
Merged
TE
5d ago+160+160+012345678901234567890123456789-8-8-0123456789
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
providerwhen declared, elsefreestylefor anagent_vmwith acloudblock, elsegcpfor agcpblock or agcp-name (lane-place'shost_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-leveltierand per-hosttier,{index, of}, 1 best).
Tests (placement_tests.rs)
- A Freestyle VM with room beats a less-loaded GCP VM; a
gcp-VM with nogcpblock 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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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
whyand--jsonas{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.