You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agent-device front drops the allocate's mode, so a full simulator cannot be leased through it #1223
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
Worker with ios.defaultMode: slim, agent-device on.
POST /v1/agent-device/rpcagent_device.lease.allocate with { platform: "ios", mode: "full", leaseId, ... }.
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.
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.
Activity
fix(agent-device): an allocate's device mode reaches the lease request (
vitalyiegorov commentedon Nov 3, 2026
Correction: agent-device already uses
modefor other commands (back --mode in-app|system), so its device-spec key isdeviceMode(--device-mode slim|full), proposed in callstack/agent-device alongside this. The front readsdeviceModeand sends it as the lease'smode.Written by an agent.
fix(agent-device): an allocate's device mode reaches the lease request (
fix(agent-device): an allocate's device mode reaches the lease request (
fix(agent-device): lease.request alone refuses a bad device mode (cal…
fix(agent-device): document deviceMode as the wire field and test the…
docs(agent-device): a null deviceMode is absent, not refused (callsta…
docs(agent-device): a slim deviceMode is best effort (callstackincuba…
V3RON commentedon Nov 5, 2026
Reproduction
Confirmed, with the key named
deviceModeas 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.tsonbug/1223-repro, "allocate withdeviceMode"full" or "slim" on a worker whoseios.defaultModeis slim makes a lease request whose mode is that value and is granted a device of that mode; …carries nodeviceMode;deviceMode: "tiny"answersrefused by simlock:and leaves no lease":The fix below, applied locally, turns it green.
Root cause
Gap.
leaseCallFields(src/agent-device/shared/rpc.ts:103) reads nodeviceMode, soplanOf(src/agent-device/front/allocate.ts:131) sends nomodeand 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) keepsdeviceMode, which a daemon that knows the key would refuse asdevice-spec-unsupported.Simplest fix
One PR; #1225 proposes it. Pinned shape:
deviceMode(slim|full) →modeonlease.request; an invalid value refused by its schema (refused by simlock: …);nullis absent;forwardedBodydropsdeviceMode. Manual andagent-device.mdxupdated.Alternatives rejected
mode: taken by agent-device'sback --mode.Risk
ruleLeaseKeys(front/request-rules.ts:137) strips onlyosVersion/imageTagfrom batch steps; checkdeviceModethere.modemust reach the worker untouched (ADR 0007 §2).Written by an agent.
test(agent-device): deviceMode has its own test file, and leaves batc…
docs(agent-device): the batch-step comment no longer counts the keys (c…
fix(agent-device): an allocate's device mode reaches the lease request (