feat(schema,engine,client-core): simulator wire contract — availability, device commands, screenshot (CODE-394)#251
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22b07391da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR adds the simulator wire contract across the schema, engine, and client packages. The main changes are:
Confidence Score: 5/5This looks safe to merge. No additional blocking issue met the follow-up review criteria.
What T-Rex did
Important Files Changed
Reviews (2): Last reviewed commit: "fix(sim): reject unknown sessions and ro..." | Re-trigger Greptile |
|
Rebased onto master (which now carries the #247+#266 sidecar/service fixes) and addressed this PR's findings in d5c2466:
Added regression tests for session rejection and claim rollback; the wire request-handler test now drives real sessions. |
Summary
Stacked on #249. The simulator surface reaches the wire (WIRE_PROTOCOL_VERSION 43 → 44):
simulator.*variants —status/status.result(the capability gate:available:falseis an answer, never an error),list/listed,devices.changedbroadcast, and session-scoped commandsboot/shutdown/install/launch(→launchedpid)/terminate/open-url/screenshot(→screenshottedbase64). Model shapes inmodel/simulator.ts.SimulatorRequestHandlerroutes commands throughSimulatorService(ownership/cap/reclaim enforced there); after boot/shutdown it re-lists and broadcastssimulator.devices.changedbest-effort (the engine has no CoreSimulator watcher — its own commands are the only observable change source).service.status()caches a successful probe, re-probes failures so installing Xcode heals the capability without a restart.simulator*methods onLinkCodeClient/ControlChannelvia the sharedPendingRegistrycorrelation, plussubscribeSimulatorDevicesChanged.Availability is request/reply (
simulator.status) rather than an unsolicited broadcast — it's connection-constant per host, mirroringagent-runtime.list; the dynamic part (device state) is what broadcasts.Verification
conflict).pnpm check:ci+pnpm test(1772) green.simulatorStatus→ available with simctl path; 11 devices listed;boot→devices.changedpush showsiPhone 17: Booted; screenshot 505 KB JPEG over base64 round-trips and decodes;shutdown→ second push showsShutdown.