Repository navigation
refactor(mobile): set permissions on the app by name, without an open first - #1025
Merged
okwasniewski merged 4 commits intoOct 12, 2026
Merged
okwasniewski merged 4 commits into
okwasniewski merged 4 commits into
Conversation
… first agent-device 0.21.21 takes an explicit app on settings permission (callstack/agent-device#3179), so a permission needs no open to put the session on the app. Drops the session-app bookkeeping, the sessions list at worker start, the refusal-text retry, and the binding's sessionApp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.21.25 resolves a display name on settings permission --app (callstack/agent-device#3386), which the explicit-app permission change needs for a target pinned by display name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thymikee
marked this pull request as ready for review
October 12, 2026 06:51
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssions-explicit-app
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.
What and why
agent-device's
settings permissionacted only on the app its session was on. To set a permission before the first launch, the engine opened the app first just to put the session on it. That took:sessionAppfield on the surface and on every slot binding;sessions.listat worker start, to check that the warm-up's session survived;setPermissionand before the permissions a launch presets;requires an active app in session.agent-device 0.21.21 takes an explicit
app(callstack/agent-device#3179, filed from this integration), and 0.21.25 resolves a display name there and refuses an app that isn't installed (callstack/agent-device#3386). This PR bumpsagent-deviceto 0.21.25 for that: on 0.21.22 a target pinned by display name (bundleId: 'Settings', as in the quickstart) would get its permission written for a client literally namedSettings.simctl privacyandpmneed only the id, not a running app. All of the above is gone:The permission call carries the worker's device selection. Before, the open in front of it bound the session to the device; without that open, a worker with no session (after
closeApp, or on a slot whose earlier worker retired) would send the change to the daemon's default device.device.setPermission()acts on the pinned app, as its docs say, not on whichever app the session last opened.The warm-up in
preparestill opens the pinned app, so a test that starts withoutapp.open()finds it on screen. Its other reason, that a timed-out open resets the daemon every slot shares, is gone since agent-device 0.21.21 (callstack/agent-device#3177), and the comments say so.flowchart LR subgraph main A1[open app, foreground] --> B1[settings permission] --> C1[open --relaunch] end subgraph this branch B2[settings permission --app] --> C2[open --relaunch] endVerified
Ran it locally: yes
com.apple.Maps. The test runsdevice.closeApp(),device.setPermission('photos', 'grant'),app.open(),device.closeApp(),device.setPermission('photos', 'deny'). Commands agent-device received for the session, from itsevents.ndjson:TCC.dbhaskTCCServicePhotos | com.apple.Maps | 0from the branch's finaldeny.app: { bundleId: 'Maps' }):device.setPermission('photos', 'grant')before the firstapp.open()wrotekTCCServicePhotos | com.apple.Maps | 2.Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it..d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures.e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.DeviceLeaseloses the optionalsessionAppit inherited fromSlotBinding. It was never documented, and the lease-to-binding path already dropped it.🤖 Generated with Claude Code