Skip to content

[Bug]: Local device tools reuse an incompatible agent-device daemon after an upgrade #41190

Done

Description

@grcasey

On macOS, T3 Code Nightly installed the required agent-device 0.21.41 while its detached 0.21.36 daemon kept running. Simulator commands failed with an RPC protocol mismatch even though T3 showed the local host as ready. After I stopped the idle daemon gracefully, opening a simulator started 0.21.41 and the same device connection could list simulators again.

The local host should check that the running daemon is compatible with the installed client before reusing its connection. If a safe restart has to wait for active sessions, T3 should tell the user what is blocking the upgrade.

Reproduction and verification
  • Environment: T3 Code Nightly 0.1.12-nightly.20261122.5111 on macOS, with a local iOS Simulator host. The tool pin changed in chore(devices): bump agent-device to 0.21.41 and expo-device-hub to 0.26.1 #40095.
  • Reproduction: leave the detached 0.21.36 daemon running, update T3 to a build that pins 0.21.41, and issue an agent-device command through the local Device panel connection. The affected host reported required 0.21.41, installed 0.21.36 and 0.21.41, and running 0.21.36. The error was Remote daemon RPC protocol is incompatible.
  • Cause in this build: LocalDeviceHost.startAgentDeviceDaemon reuses the existing endpoint whenever its /health returns HTTP 200 and combines it with the newly installed client's entry path. The local startup path also sets AGENT_DEVICE_DAEMON_IDLE_TIMEOUT_MS=0, so the detached process can outlive the update indefinitely.
  • Recovery: after confirming no active runtime leases or booted simulators, I ran the 0.21.36 CLI's daemon stop --state-dir <T3 agent-device state directory>. It returned Daemon stopped (graceful). The next device_open started 0.21.41. The returned T3-bound agent-device devices --json exited 0 with "success": true and listed 18 iOS/iPadOS simulators. A final T3 device list confirmed 0.21.41 still running after the verification simulator was closed.
  • Open decision: how to surface the version mismatch when the existing daemon is busy. Suggested default is to preserve active sessions, report the blocking state, and retry the handover once safe.

Related protocol bump: #41057 covers a Simlock pool. This reproduction uses the built-in local host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions