fix(daemon): enforce device claim for commands with explicit selector

Merged
TW
1d ago
+196-70

Fixes #4228

Cause. When a request carries an explicit device selector alongside an unheld session name, requireNamedSessionHoldsDevice bypassed the missing session check, allowing snapshot and interaction commands to resolve the device and construct a new session even when another active session already held that device.

Fix. Enforce the device claim in resolveSessionDevice, resolveSelectorRuntimeDevice, and targeted touch admission before capture, input, or session creation, refusing conflicting requests with DEVICE_IN_USE. Added a patch changeset.

Test. Added snapshot and press with device selector are refused when another session holds device (#4228) in request-router-bounded-claim-recovery.test.ts. The rest of the test suite, oxlint, and oxfmt are clean.

This change was prepared with the assistance of an AI coding agent (GPT-6-astra).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.