Repository navigation
Preserve HTTP helpers and add explicit exclusive control sessions - #6
Draft
TimofeyIvanenko wants to merge 5 commits into
Draft
TimofeyIvanenko wants to merge 5 commits into
TimofeyIvanenko wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep simple Python command calls on HTTP while providing explicit exclusive control for multi-step workflows. This accompanies the shared command service in NomixClicker #747.
Clicker(device_id).click((x, y))and existing publicapi_helpercommand functions work without opening a WebSocket. Command names, parameters and defaults are preserved. HTTP errors stop the caller; busy and uncertain outcomes are exposed asControlError, and a lost response is never automatically retried.with Clicker(device_id)or explicitconnect()/close()retains exclusive WebSocket ownership between workflow steps. Acquisition does not steal control unlesstakeover=Trueis requested. Both transports use canonical command names (tap,double-tap,keyboard/type,move, etc.). A failed or closed exclusive session never falls back to HTTP, reconnects or replays commands.Typing derives its bounded deadline from the server's
text_timeout_ms, with a finite dispatch budget. HTTP typing reads authenticated control discovery; persistent sessions receive timing through state/acquisition. Invalid timing fails before sending input. Acquisition timing cannot overwrite newer ownership state, and an explicitly supplied request timeout is preserved. Ordinary command timeouts remain unchanged.Update examples, action helpers and publishing validation for SDK 0.2. Results confirm best-effort dispatch, not execution on the phone. Cancellation stops unsent input; already transmitted input may continue or overlap later actions on the device. No hardware completion replies are required. Screenshots, recognition, media and agent task management remain HTTP.
Validation: 105 tests pass, including HTTP helpers without connection setup, busy/error propagation, uncertain delivery without retry, explicit ownership, no HTTP fallback after WebSocket loss, request correlation, disconnects and server-derived typing deadlines for convenience/raw HTTP and exclusive requests. No physical device commands were sent. Exclusive sessions and advertised typing budgets require the matching server release; existing HTTP clients retain their endpoint interface. SDK 0.2 intentionally raises command failures instead of returning an unchecked failure dictionary.