Skip to content

Cleanup old mechanism to use server to connect to androidMobile agent - #2863

Merged
jebrans merged 5 commits into
microsoft:mainfrom
jebrans:dev/jebransyed/android-register
Aug 13, 2026
Merged

Cleanup old mechanism to use server to connect to androidMobile agent#2863
jebrans merged 5 commits into
microsoft:mainfrom
jebrans:dev/jebransyed/android-register

Conversation

@jebrans

@jebrans jebrans commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the legacy takeAction device-command path from the mobile-2
Android sample, making registerClientAgent the sole mechanism for
onboarding the app and dispatching device actions.

The sample previously carried two parallel command paths. The
client-hosted androidDevice agent receives typed executeAction
callbacks and returns a result to TypeAgent. The older path handled
fire-and-forget takeAction calls pushed by the server-side
androidMobile agent over the clientio: channel; it duplicated the
alarm and timer handlers but discarded the outcome, so TypeAgent never
learned whether the intent actually launched.

searchNearby existed only on the legacy path, so it moves into the
client-agent schema first. It now reports success or failure back like
the other two actions instead of being fired blind.

The clientio: channel is retained — it remains the only transport for
display and user-interaction traffic (appendDisplay, setDisplay,
setDisplayInfo, notify, requestChoice, requestInteraction).
Only the takeAction branch is removed.

Example

Before

Two paths reached the same Android intents, and only one could report a
result:

androidMobile agent -> takeAction("search-nearby", ...) -> Android intent
                                                        (result discarded)

androidDevice agent -> executeAction(setTimer) -> Android intent -> ActionResult

searchNearby was reachable only through the first path, so a failure
to launch the maps app was invisible to TypeAgent.

After

One path, and every action reports its outcome:

Android app -> registerClientAgent("androidDevice", inlineSchema)
            -> executeAction(setAlarm | setTimer | searchNearby)
            -> Android intent
            -> ActionResult

searchNearby can now be tested deterministically like the other
actions:

@action --parameters {"originalRequest":"coffee","searchTerm":"coffee shops"} androidDevice searchNearby
Searching nearby for coffee shops

A failed launch now surfaces as an action error rather than silence:

No maps app is available on this device.

Notes

Verified with testDebugUnitTest, assembleDebug and lintDebug
79 tests, 0 failures, lint clean. Two tests were added covering
searchNearby parsing and its invalid-parameter path.

jebrans and others added 5 commits August 10, 2026 16:31
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>
The mobile-2 sample had two parallel mechanisms for receiving device
commands: the fire-and-forget `takeAction` calls pushed by the
server-side `androidMobile` agent over the `clientio:` channel, and
the client-registered `androidDevice` agent that receives
`executeAction` invokes and returns a result. The former is strictly
worse - it duplicated the alarm and timer handlers but discarded the
outcome, so the agent never learned whether the intent actually
launched.

Delete the `takeAction` path and make `registerClientAgent` the sole
onboarding and command mechanism. `searchNearby` existed only on the
legacy path, so it moves into the client-agent schema first; it now
reports success or failure back like the other two actions instead of
being fired blind.

`clientio:` is retained - it remains the only transport for display
and user-interaction traffic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I assume there will be a separate change to remove the takeAction definition in dispatcher and also clean up the server-side androidMobile agent?

@jebrans
jebrans added this pull request to the merge queue Aug 13, 2026
Merged via the queue into microsoft:main with commit e429848 Aug 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants