Skip to content

fix: keep Linux remotes out of the device pool and offer them in build suggestions - #3653

Merged
janicduplessis merged 2 commits into
feat/3643-linux-build-only-desktopfrom
feat/3649-linux-pool-and-suggestions
Oct 13, 2026
Merged

janicduplessis merged 2 commits into
feat/3643-linux-build-only-desktopfrom
feat/3649-linux-pool-and-suggestions

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Depends on #3647 (stack: #3610 -> #3618 -> #3621 -> #3631 -> #3638 -> #3639 -> #3647 -> this).

A Linux remote could count as a device-pool member it can never satisfy. validateAutomaticPool('device', …) accepts any configured remote with an approved device-host credential, and hostingMachines() hands every asked machine to automatic placement. A Linux machine can hold such a credential: a Linux stim-server accepts device-host requests, and stim-server devices grant <id> --device-host has no platform check (only setup refuses --device-host there). Before #3639, stim doctor --fix also asked Linux machines for device-host access. So stim settings set remote.devicePoolDisabled '["local"]', or turning off Simulators enabled for This Machine in Desktop, succeeded while the only remaining member could never host. Every --remote auto run then refused, and the Linux row no longer shows its Simulators toggle (#3647).

Desktop's build suggestions ignored Linux peers. DiscoveryCoordinator read only online macOS peers, so the new-peer and build-slot-wait suggestions never offered a Linux machine, although the wizard can add one.

Solution

CLI. Core's cannotHost(status, entry) says whether tailscale status reports the peer as running an OS other than macOS; an unknown OS (no status, peer missing, no OS) counts as able to host. It is applied in three places:

  • Pool validation. validateAutomaticPool takes a canHost predicate for the device role, and writeConfigSetting passes it. It reads tailscale status before taking the config lock, and only when the write leaves local out of the device pool, the one case where validation looks at remotes.
  • Placement. hostingMachines(), used by automatic and planned placement, drops those machines, so they are never probed or chosen.
  • Doctor. inspectDeviceHostMachines uses the same helper and now applies it even to a saved approval. Such a machine is neither contacted nor reported as approved: it shows not-asked with no finding, and the credential stays on disk. Desktop therefore never sees an approved Linux host, so its device-limit "Use Auto" prompt and its Simulators pill cannot name one.

The build pool is unchanged. I did not make the Linux server refuse device-host requests or grants: an existing approval on any server version would still need the client-side check, which this PR adds.

Desktop. DiscoveryCoordinator reads Tailnet.buildPeers (online Macs and Linux machines). The new-peer suggestion uses all of them; the build-slot suggestion preselects a Linux machine only when an Android build waited, since an iOS build cannot go there. Discovery.capHit now takes the peers and preselects only a Mac, so the device-limit suggestion stays Mac-only. With only a Linux peer it says "another Mac" and preselects nothing. The seen-peers baseline moves to a new defaults key (discovery.seenBuildPeers): the old one held only Macs, so reusing it would announce every long-present Linux node as having just joined. The first poll after the upgrade records a fresh baseline without prompting.

Test plan

  • settings-command.test.ts:
    • With a device-host-approved box that tailscale status reports as linux, stim settings set remote.devicePoolDisabled '["local"]' exits 1 and writes nothing.
    • The same machine reported as macOS is accepted.
    • tailscale is stubbed through the executor.
  • device-host-machines.test.ts:
    • hostingMachines drops a peer reported as linux and keeps it when the status is unknown.
    • Doctor neither contacts nor reports as approved a saved approval for a peer reported as linux.
  • The hosted iOS and Android client tests stub realIo.status, so no test runs the real tailscale binary.
  • DiscoveryTests: the device-limit suggestion skips a Linux peer and picks the Mac when both are online; the build-slot suggestion picks the Linux peer after an Android wait and the Mac after an iOS wait.
  • Desktop built and launched with stim macos; stim logs --errors was empty. The screen was still locked, so there are no new window screenshots; the suggestion banners are unchanged visually.

Fixes #3649

@janicduplessis
janicduplessis added this pull request to stack #3619 October 13, 2026 06:55
@janicduplessis
janicduplessis force-pushed the feat/3649-linux-pool-and-suggestions branch 3 times, most recently from de3f45b to 1d2a905 Compare October 13, 2026 07:21
@janicduplessis janicduplessis added the review: ai-approved A fresh AI review found nothing left to fix label Oct 13, 2026
@janicduplessis
janicduplessis marked this pull request as ready for review October 13, 2026 16:50
@janicduplessis
janicduplessis added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Oct 13, 2026
@janicduplessis
janicduplessis force-pushed the feat/3649-linux-pool-and-suggestions branch from 1d2a905 to 5790e2f Compare October 13, 2026 17:58
@janicduplessis janicduplessis added review: ai-approved A fresh AI review found nothing left to fix and removed review: ai-approved A fresh AI review found nothing left to fix labels Oct 13, 2026
@janicduplessis
janicduplessis added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Oct 13, 2026
@janicduplessis
janicduplessis force-pushed the feat/3649-linux-pool-and-suggestions branch from 5790e2f to 6126da1 Compare October 13, 2026 19:11
@janicduplessis
janicduplessis force-pushed the feat/3649-linux-pool-and-suggestions branch from 6126da1 to bbee4d3 Compare October 13, 2026 20:29
@janicduplessis
janicduplessis added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit ce0fdd4 Oct 13, 2026
24 checks passed
@janicduplessis
janicduplessis deleted the feat/3649-linux-pool-and-suggestions branch October 13, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux remote machines: never device-pool members; offered in build suggestions

1 participant