fix(limrun): list only the connection's instance in devices

Merged
TH
2d ago
+99-5

Summary

On a Limrun connection, devices listed this host's simulators, emulators and USB devices instead of the Limrun instance. The daemon's devices query dropped the request's leaseProvider and leaseId, so the Limrun inventory declined and the provider-first gateway fell back to local inventory. A Limrun lease with no live session also declined, which had the same effect.

  • devices passes the request's lease scope to the inventory when the provider needs a runtime (leaseProviderRequiringRuntime). Proxy and cloud connections keep listing the host behind them.
  • The Limrun inventory answers an empty list for its own lease when no session is live, instead of declining.
  • website/docs/docs/limrun.md says what devices lists.

6 files. Fixes #4304.

Validation

Head a195bc490b: pnpm check:affected --run --head a195bc490b passed, exactCommit=true. The new daemon tests fail on base (Limrun) and on the previous head (proxy).

Live run on Limrun iOS with the source CLI: connect limrun --platform ios, devices --json, open com.apple.Preferences, devices --json, then cleanup.

Connectionbase (inventory code as on main)head (3ec88a7e42; re-run at a195bc490b for API key)
API key25 entries: host iOS simulators and a USB iPhone, no Limrun device (before and after open; run on 83945b7a9f)1 entry: limrun:ios:<lease> "Limrun ios ios_euna" (before and after open)
Existing instance (LIM_IOS_INSTANCE_*)25 host entries, before and after open1 entry: limrun:ios:<lease> "Limrun ios attached"

Unchanged: on a fresh API-key connection, devices still allocates the instance, like any first device command. Every instance was released.

šŸ¤– Generated with Claude Code