fix(agent-device): an allocate's device mode reaches the lease request (#1223)
Closes #1223.
The agent-device front now reads an allocate's deviceMode (slim | full) into the lease request's mode, as ADR 0007 §2 asks of every transport. Why: Apple Pay / PassKit (Wallet) flows need a full iOS simulator on a farm whose ios.defaultMode is slim, and through agent-device every lease got the default.
leaseCallFieldsreadsdeviceMode;planOfputs it in the plan asmode, solease.requestandlease.requestedcarry it as asked.- A bad
deviceModereacheslease.request, whose schema is the one check, and answersrefused by simlock: mode: Invalid option: expected one of "slim"|"full".deviceMode: nullis absent, likeosVersion,physicalandttlMs. - The allocate forwarded to the agent-device daemon drops
deviceMode, andruleLeaseKeysremoves it from commands and batch steps, as fordeviceBaseline. - The test is in its own
device-mode.test.ts, becauseedge.test.tsmay only shrink (ADR 0063). - Website page and module manual updated.
Client side: callstack/agent-device#4183 is merged and unreleased, so the docs say --device-mode needs the release that adds it.
Status
- Allocate with
deviceModefull or slim makes a lease request whosemodeis that value and grants a device of that mode —device-mode.test.ts; removing the read turns it red - Invalid
deviceModerefused with simlock's message, and no lease is made;nullgets the default — same test - The forwarded allocate and every command or batch step carry no
deviceMode—device-mode.test.ts; removing either strip turns a test red -
pnpm exec vitest run --project unit src/agent-device/ src/source-hygiene.test.ts— 518 passed, 1 skipped, at dd3237b; typecheck andoxlintclean - Real gateway + worker (0.5.0 with this patch, before the refusal moved to
lease.request), raw/v1/agent-device/rpc:deviceMode: "full"→ leasemode: full, 0 disabled launchd labels; nodeviceMode→mode: slim, 170 disabled (incl.com.apple.passd). Not repeated on this head
Assumptions
- Assumption: new ADR? — no; ADR 0007 §2 already decides it, this closes a gap against it
- Assumption: field name —
deviceMode, because agent-device'smodeis taken by other commands
Review
Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 2 fixed, 0 notes. Claims review: 0 blocking, 1 fixed, 0 notes.
Assessment: complete
Rounds: 2. Tokens: 0.45M.
External contribution: the spec, code and claims briefs ran as separate agents from a fork clone, not through the reviewer agent, so the ledger's metrics are unknown. The round 2 code lens had no dependencies and marked itself incomplete, so its coordinator then ran the tests and three mutation probes above. Spec ran in round 1 only.
Written by an agent.