Skip to content

agent-device front drops the allocate's mode, so a full simulator cannot be leased through it #1223

Closed

Description

@vitalyiegorov

What happened

An agent-device allocate that carries mode: "full" gets a slim iOS simulator on a worker whose ios.defaultMode is slim. The agent-device front drops mode before lease.request: leaseCallFields (src/agent-device/shared/rpc.ts) and planOf (src/agent-device/front/allocate.ts) keep platform, model/class, osVersion, imageTag, physical and ttlMs only.

What you expected

ADR 0007 §2: transports pass the request's mode through untouched. An allocate with mode: "full" or "slim" should reach lease.request with it; an invalid mode should be refused.

How to reproduce

  1. Worker with ios.defaultMode: slim, agent-device on.
  2. POST /v1/agent-device/rpc agent_device.lease.allocate with { platform: "ios", mode: "full", leaseId, ... }.
  3. lease.requested shows requestSpec: { platform: "ios" }; the simulator boots slim.

Environment

simlock 0.5.0, gateway + one macOS worker; agent-device 0.21.36.

Logs and evidence

Motivation: Apple Pay / PassKit (Wallet) flows need a full simulator, on a farm that is otherwise slim.

Written by an agent.

Activity

  1. vitalyiegorov commented on Nov 3, 2026

    @vitalyiegorov
    ContributorAuthor

    Correction: agent-device already uses mode for other commands (back --mode in-app|system), so its device-spec key is deviceMode (--device-mode slim|full), proposed in callstack/agent-device alongside this. The front reads deviceMode and sends it as the lease's mode.

    Written by an agent.

  2. added
    bug:new
    platform:ios
    on Nov 5, 2026
  3. self-assigned this
    on Nov 5, 2026
  4. V3RON commented on Nov 5, 2026

    @V3RON
    Contributor

    Reproduction

    Confirmed, with the key named deviceMode as the comment above corrects (callstack/agent-device#4183, merged today; installed 0.21.35 lacks it). Same root cause as #1104, likely a duplicate. The expectation is a proposal (gap).

    src/agent-device/edge.test.ts on bug/1223-repro, "allocate with deviceMode "full" or "slim" on a worker whose ios.defaultMode is slim makes a lease request whose mode is that value and is granted a device of that mode; …carries no deviceMode; deviceMode: "tiny" answers refused by simlock: and leaves no lease":

    pnpm exec vitest run --project unit src/agent-device/edge.test.ts -t deviceMode
    
    AssertionError: expected [ { platform: 'ios' } ] to deeply equal [ { mode: 'full', platform: 'ios' } ]
     ❯ src/agent-device/edge.test.ts:768:47
    

    The fix below, applied locally, turns it green.

    Root cause

    Gap. leaseCallFields (src/agent-device/shared/rpc.ts:103) reads no deviceMode, so planOf (src/agent-device/front/allocate.ts:131) sends no mode and the worker default applies. ADR 0023 lists the mapped selectors without a mode, since agent-device had none until #4183. Also, forwardedBody (allocate.ts:262) keeps deviceMode, which a daemon that knows the key would refuse as device-spec-unsupported.

    Simplest fix

    One PR; #1225 proposes it. Pinned shape: deviceMode (slim | full) → mode on lease.request; an invalid value refused by its schema (refused by simlock: …); null is absent; forwardedBody drops deviceMode. Manual and agent-device.mdx updated.

    Alternatives rejected

    Risk

    Written by an agent.

  5. removed their assignment
    on Nov 5, 2026
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

    bug:newplatform:ios

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions