install and reinstall from another session in the same daemon replace the app on a claimed device
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- ios, typescript
Research direction
Start by tracing how install and reinstall use transient-exclusive claims, then compare that path with the session-store check used by open. Reproduce with two sessions sharing one daemon and a claimed iOS simulator; verify that the non-owning session gets DEVICE_IN_USE while the owning session can still install and reinstall. Check whether the other listed transient-exclusive commands have the same behavior.
Written by the indexing model from the issue text.
Description
Seen in 0.20.10, 0.21.12 and 0.21.23 on macOS with iOS simulators.
Repro
Both sessions use the default state dir, so they share one daemon, as two agents in separate worktrees of the same repo do:
agent-device open com.apple.Preferences --platform ios --udid <UDID> --session a
agent-device device status --platform ios --udid <UDID>
# live session=a
agent-device open com.apple.Preferences --platform ios --udid <UDID> --session b
# DEVICE_IN_USE: Device is already in use by session "a". (expected)
agent-device reinstall <bundle-id> /path/to/App.app --platform ios --udid <UDID> --session b
# Installed: <bundle-id> (session a's app is replaced)
agent-device install <bundle-id> /path/to/App.app --platform ios --udid <UDID> --session b
# Installed: <bundle-id>
When session b runs on another state dir (AGENT_DEVICE_STATE_DIR), install and reinstall fail as expected:
DEVICE_IN_USE: ios device <UDID> is owned by session "a" in workspace "<workspace>".
Cause
#1809 made install and reinstall transient-exclusive, and a claim already held by the same daemon process covers the command instead of colliding with it. That is right for the session that owns the claim, but any other session in that daemon is covered too. open is still protected by the session store check; the sessionless mutations are not.
Impact
Agents working in parallel worktrees share the default daemon, so whether an install is fenced off depends on whether each worktree happens to run its own daemon. In our case one agent's build replaced the app another agent was testing.
Expected
install and reinstall targeting a device that a different session in the same daemon holds fail with DEVICE_IN_USE, the same as open. Passing the owning --session keeps working. I only tested install and reinstall; the other transient-exclusive commands (boot, shutdown, push, prepare) may behave the same way.
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 328
- Avg merge
- 12h 18m
- Merged PRs (30d)
- 538
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
callstack/agent-device#3353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
callstack/agent-device#3392 ·
Maintainers usually reply within 1 day
-
settings permission --app writes a display name as the bundle id instead of resolving itPossibly taken @thymikee claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 22/100
callstack/agent-device#3384 ·
Maintainers usually reply within 1 day
-
iOS: a canceled request releases the session lock while its runner command still runs on the devicePossibly taken @thymikee claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 22/100
callstack/agent-device#3383 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
chore v2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/servers#5115 ·
Maintainers usually reply within 1 day
-
beginner bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
philaconvalley/website#168 ·
Maintainers usually reply within 1 day
-
bug frontend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
oss-slu/lrda_mobile#294 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
hatchet-dev/hatchet#5179 ·
Maintainers usually reply within 1 day