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 answers orientation for an iPhone Duo with an input-helper rotate the Duo ignores #1539
On a leased iPhone Duo simulator (iOS 27.3), agent-device orientation landscape-left through the
gateway's agent-device front returns Rotation requested: landscape-left (unconfirmed) with exit 0.
Neither panel turns: agent-device screenshot stays 669x951 (inner panel) or 466x678 (outer panel).
What you expected
The command should reach agent-device. Its fold helper rotates the Duo's lit panel and confirms it from
the panel's orientation. That is what happened before the front began answering orientation (#1109).
How to reproduce
Lease an iPhone Duo simulator (iOS 27.3) through the gateway.
Using the lease's agent-device command, run open com.apple.mobilesafari, then orientation landscape-left.
The command exits 0 with "unconfirmed", and screenshot is still portrait. It happens every time.
Environment
simlock 0.7.0 (worker and gateway), agent-device 0.21.36, macOS 27.3 arm64, Xcode 27.3, iOS 27.3
runtime. main at ee19e97 has the same code.
Logs and evidence
src/daemon/rotation-refusal.ts: rotationRefusal allows every simulator model that isRotatableModel accepts, and "iPhone Duo" is in the iPhone family.
src/agent-device/front/orientation.ts: the front then dispatches device.rotate (the input
helper's orientation event) and replies "unconfirmed".
The Duo's guest ignores that event: no panel turns, and the display table's currentOrientation does
not change.
The local workaround we run refuses rotation for the Duo, so the front forwards the command:
constFOLDABLE_IOS_MODELS=newSet(["iPhone Duo"]);exportfunctionrotationRefusal(leaseId,spec){if(!spec.physical&&spec.platform==="ios"&&FOLDABLE_IOS_MODELS.has(spec.model)){returnnewDispatchError("ROTATION_UNSUPPORTED",`Lease ${leaseId} is on a foldable ${spec.model} simulator; agent-device rotates it through its fold helper`,{class: "phone", leaseId,physical: false,platform: spec.platform});}// ... unchanged
Results with the workaround:
The iPhone Duo gets ROTATION_UNSUPPORTED; the iPhone 17 Pro is unchanged.
3 fresh Duo leases: portrait, landscape-left and landscape-right on the inner panel, portrait on the
outer panel, and portrait after fold and unfold all exit 0, with matching screenshots (669x951,
951x669, 466x678).
A device capability such as foldable or multi-display would hold up better than a model list, if
simlock can see one.
Confirmed: this is a Decision, not a defect. The code does what ADR 0053 §4 says ("an iPhone or iPad", by name prefix). That rule is wrong for the Duo, whose guest ignores the input helper's rotation (reporter's evidence).
src/agent-device/front/orientation.test.ts on bug/1539-repro, "forwards orientation <name> on an iPhone Duo simulator lease to agent-device, through a gateway and on a worker, and device.rotate refuses that lease ROTATION_UNSUPPORTED". Its device.rotate fake calls the real rotationRefusal.
pnpm exec vitest run --project unit src/agent-device/front/orientation.test.ts
AssertionError: expected undefined to be 'ROTATION_UNSUPPORTED'
❯ src/agent-device/front/orientation.test.ts:290:49
expect(rotationRefusal(leaseId, duo)?.code).toBe("ROTATION_UNSUPPORTED")
Root cause
src/contract/orientation.ts:24isRotatableModel accepts every model in the phone family, and "iPhone Duo" starts with iPhone. Both the daemon's rotationRefusal (src/daemon/rotation-refusal.ts:31) and the front's answerOrientation (src/agent-device/front/orientation.ts:67) read it. So the front sends device.rotate, the helper's GSEvent reaches a foldable that ignores it, and the front answers "unconfirmed" instead of forwarding to agent-device's fold helper.
Simplest fix
A short ADR narrowing ADR 0053 §4/§5: a foldable iOS simulator (iPhone Duo) is refused ROTATION_UNSUPPORTED. Then isRotatableModel returns false for a FOLDABLE_MODELS set, and rotationRefusal says Lease <id> is on a iPhone Duo simulator; Simlock cannot rotate a foldable simulator (proposed wording; the test pins only the code). Update src/agent-device/AGENTS.md, watching-the-screen.mdx (rotate section, the 422 row), agent-device.mdx:148 and programmatic-client.mdx:144.
# applied, then git restore'd
pnpm exec vitest run --project unit src/agent-device/front/orientation.test.ts src/mcp/server-devices.test.ts \
src/cli/index-update-status-stats.test.ts src/simlock-client/client-pushes.test.ts # 36 passed
pnpm exec vitest run --project unit src/daemon/device-rotate.e2e.test.ts # 7 passed
Alternatives rejected
Refuse in rotationRefusal only (reporter's workaround): the front still round-trips to the worker per Duo orientation.
Make the input helper rotate the Duo's lit panel: agent-device already does this; it is a feature-sized helper change.
A device capability (foldable, multi-display) instead of a model list: the device record holds only the model, so this needs a new driver fact.
Risk
device.rotate, simlock rotate and MCP rotate_device on a Duo go from 200 (does nothing) to 422: a caller-visible change.
The model name must match what the iOS driver lists exactly (iPhone Duo).
Fast track
Defect: no — decision: ADR 0053 §4 names every iPhone
Fix tried: yes
Nothing public added or broken: no — device.rotate on a Duo turns 200 into 422
No ADR or rule changed: no — narrows ADR 0053 §4/§5
One fix: no — a helper that rotates the Duo keeps simlock rotate working
Take the triage fix: agent-device rotates the Duo, simlock's own rotate refuses it.
How agent-device rotates a Duo (packages/platform-apple/src/foldable/orientation.ts, agent-device #3968, in 0.21.34 and later, so in our 0.21.36 pin):
A simulator with more than one integrated panel is foldable (panel table, not the model name).
It runs its fold helper (apple/fold-helper/Fold.m) in the guest through simctl spawn (--set aware) and sends the private orientation-picker-control HID event. XCTest rotation and simlock's GSEvent rotate do nothing on a Duo.
The value depends on the lit panel: the inner panel is offset by +90°.
It confirms from the lit panel's currentOrientation, else fails orientation-unverified.
portrait-upside-down is refused UNSUPPORTED_OPERATION. Needs Xcode 27.1+.
Simlock change
isRotatableModel returns false for iPhone Duo. The agent-device front then forwards orientation on a Duo lease to agent-device, which rotates and confirms it.
device.rotate, simlock rotate and MCP rotate_device on a Duo answer ROTATION_UNSUPPORTED (today 200 that does nothing). The message names the foldable and points to agent-device orientation.
ADR 0053 §4/§5 narrowed to say so; docs from the triage list updated (src/agent-device/AGENTS.md, watching-the-screen.mdx, agent-device.mdx, programmatic-client.mdx).
Out of scope: simlock's own rotate turning a Duo (needs a guest helper, panel-table read and per-panel mapping in the iOS driver). A separate spec if someone needs it.
Activity
V3RON commentedon Nov 18, 2026
Reproduction
Confirmed: this is a Decision, not a defect. The code does what ADR 0053 §4 says ("an iPhone or iPad", by name prefix). That rule is wrong for the Duo, whose guest ignores the input helper's rotation (reporter's evidence).
src/agent-device/front/orientation.test.tsonbug/1539-repro, "forwardsorientation <name>on an iPhone Duo simulator lease to agent-device, through a gateway and on a worker, anddevice.rotaterefuses that leaseROTATION_UNSUPPORTED". Itsdevice.rotatefake calls the realrotationRefusal.Root cause
src/contract/orientation.ts:24isRotatableModelaccepts every model in thephonefamily, and"iPhone Duo"starts withiPhone. Both the daemon'srotationRefusal(src/daemon/rotation-refusal.ts:31) and the front'sanswerOrientation(src/agent-device/front/orientation.ts:67) read it. So the front sendsdevice.rotate, the helper's GSEvent reaches a foldable that ignores it, and the front answers "unconfirmed" instead of forwarding to agent-device's fold helper.Simplest fix
A short ADR narrowing ADR 0053 §4/§5: a foldable iOS simulator (
iPhone Duo) is refusedROTATION_UNSUPPORTED. ThenisRotatableModelreturns false for aFOLDABLE_MODELSset, androtationRefusalsaysLease <id> is on a iPhone Duo simulator; Simlock cannot rotate a foldable simulator(proposed wording; the test pins only the code). Updatesrc/agent-device/AGENTS.md,watching-the-screen.mdx(rotate section, the 422 row),agent-device.mdx:148andprogrammatic-client.mdx:144.Alternatives rejected
rotationRefusalonly (reporter's workaround): the front still round-trips to the worker per Duoorientation.Risk
device.rotate,simlock rotateand MCProtate_deviceon a Duo go from 200 (does nothing) to 422: a caller-visible change.iPhone Duo).Fast track
device.rotateon a Duo turns 200 into 422simlock rotateworkingWritten by an agent.
V3RON commentedon Nov 18, 2026
Decision
Take the triage fix: agent-device rotates the Duo, simlock's own rotate refuses it.
How agent-device rotates a Duo (
packages/platform-apple/src/foldable/orientation.ts, agent-device #3968, in 0.21.34 and later, so in our 0.21.36 pin):apple/fold-helper/Fold.m) in the guest throughsimctl spawn(--setaware) and sends the privateorientation-picker-controlHID event. XCTest rotation and simlock's GSEvent rotate do nothing on a Duo.currentOrientation, else failsorientation-unverified.portrait-upside-downis refusedUNSUPPORTED_OPERATION. Needs Xcode 27.1+.Simlock change
isRotatableModelreturns false foriPhone Duo. The agent-device front then forwardsorientationon a Duo lease to agent-device, which rotates and confirms it.device.rotate,simlock rotateand MCProtate_deviceon a Duo answerROTATION_UNSUPPORTED(today 200 that does nothing). The message names the foldable and points toagent-device orientation.src/agent-device/AGENTS.md,watching-the-screen.mdx,agent-device.mdx,programmatic-client.mdx).Out of scope: simlock's own rotate turning a Duo (needs a guest helper, panel-table read and per-panel mapping in the iOS driver). A separate spec if someone needs it.
Written by an agent.
test: the Duo refusal message names the foldable and points to agent-…
docs: the other lines that say who rotates name the foldable exception (
V3RON commentedon Nov 18, 2026
Delivery run
Merged: #1730 (#1539)
Parked: none
Waiting: none
Decided: none
Written by an agent.
fix(agent-device): a foldable iPhone Duo's orientation goes to agent-…