Skip to content

fix: refuse device-host requests and grants on a stim-server that is not on macOS - #3657

Merged
janicduplessis merged 2 commits into
mainfrom
fix/3656-refuse-device-host-off-mac
Oct 13, 2026
Merged

janicduplessis merged 2 commits into
mainfrom
fix/3656-refuse-device-host-off-mac

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

Depends on #3631, which lets stim-server run as a service and take setup --build on Linux. It branches from #3631 beside #3638, #3640 and #3645, so it is not linked into the #3619 stack.

Hosting simulators needs a Mac. Since #3631, stim-server setup on Linux refuses --device-host, but two other paths still accepted it on any OS:

  • a hello with request: 'device-host', which recorded a pending device-host request;
  • stim-server devices grant <id> --device-host, which approved one.

#3653 makes clients ignore non-macOS machines for hosting, so such an approval is harmless today. The server should still not record a capability it can never serve.

Solution

Off macOS, the hello refuses a device-host request with forbidden, "Hosting simulators needs a Mac. This machine takes build requests only." The request is not recorded. devices grant --device-host fails with the same reason and points to --build. Build requests and grants are unchanged.

startServer takes a hostsDevices option, defaulting to running on macOS, so tests can set it on any OS. Existing device-host records are left alone; the client-side checks from #3653 cover them.

Test plan

  • server.test.ts: with hostsDevices: false, a device-host hello is refused with forbidden and records no client. A build request from the same server is still approved and answers build.offer.
  • cli.test.ts: devices grant --device-host is approved on macOS. On CI's Linux and Windows runners it is refused with the new message. The server test helper declares hostsDevices: true, so the existing device-host tests keep their behavior on every runner.

Fixes #3656

@janicduplessis janicduplessis added area: server packages/server area: docs docs/ and root documents 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 force-pushed the feat/3624-linux-server-service branch from 7dfa204 to 61e0c6e Compare October 13, 2026 17:51
@janicduplessis
janicduplessis force-pushed the fix/3656-refuse-device-host-off-mac branch from 176d5a6 to f041be4 Compare October 13, 2026 18:04
@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
An error occurred while trying to automatically change base from feat/3624-linux-server-service to feat/3620-rate-by-platform October 13, 2026 19:11
…not on macOS

Hosting simulators needs a Mac, but a Linux or Windows stim-server
accepted a device-host request at hello and devices grant --device-host
approved it. Both now refuse with a message that the machine takes build
requests only.

Refs #3656
The test asks for device-host access, which a server not on macOS now
refuses, so it failed on the Linux CI runners.

Refs #3656
@janicduplessis
janicduplessis force-pushed the fix/3656-refuse-device-host-off-mac branch from f041be4 to ce69d4c Compare October 13, 2026 20:29
@janicduplessis
janicduplessis changed the base branch from feat/3624-linux-server-service to main October 13, 2026 20:29
@janicduplessis
janicduplessis marked this pull request as ready for review 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 ca919c5 Oct 13, 2026
1 check passed
@janicduplessis
janicduplessis deleted the fix/3656-refuse-device-host-off-mac branch October 13, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs docs/ and root documents area: server packages/server 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.

stim-server refuses device-host requests and grants off macOS

1 participant