Dev/jebransyed/android register - #2845
Merged
Merged
Conversation
Register an inline Android device schema from the mobile sample, route executeAction callbacks to alarm and timer intents, return action results, and cover the registration and parsing contract with focused tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hillary Mutisya (hillary-mutisya)
approved these changes
Aug 11, 2026
George Ng (GeorgeNgMsft)
approved these changes
Aug 11, 2026
jebrans
added a commit
to jebrans/TypeAgent
that referenced
this pull request
Aug 12, 2026
Integrates upstream microsoft#2845 (client-hosted Android agent) with the conversation-persistence work in this PR. Resolution notes: - WebSocketManager.connect() now takes both schemaContent (upstream) and resumeConversationId (this PR); the connect-time synchronized block seeds requestedConversationId, agentSchemaContent and resets isClientAgentRegistered. The "Conversation not found" fallback rejoin reuses the same onResult path, so registerClientAgent still runs after falling back to the default conversation. - MainActivity collects clientActionEvents in a plain lifecycleScope launch rather than repeatOnLifecycle(RESUMED). Upstream's executeAction holds a server RPC open until the completion callback fires, so gating on RESUMED would hang that RPC while backgrounded. launchExternalIntent already does its own RESUMED check and fails fast, matching upstream's behavior; the unbounded channel still buffers across configuration changes. - ClientAction.Alarm/.Timer carry upstream's completion callback. dispatchClientAction fails the completion when the channel is closed so the RPC can never leak. - Upstream's onDestroy teardown is intentionally not carried over: the socket is owned by the ViewModel and tearing it down in onDestroy would disconnect on every rotation. - README keeps both the renamed "Client-hosted Android agent" section and the rewritten "Conversation persistence" section.
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.
Summary
Enable the
mobile-2Android sample to register itself with TypeAgent asa client-hosted
androidDeviceagent usingregisterClientAgent.The app supplies an inline schema for alarm and timer actions, receives
typed
executeActioncallbacks over the existing WebSocket connection,dispatches them through Android intents, and returns success or failure
results to TypeAgent.
The existing
takeActionhandlers remain available for compatibilitywith the static
androidMobileagent.Example
Before
The Android app depended on the server-side
androidMobileagent andreceived fire-and-forget client actions: