Skip to content

[Bug]: Settling a thread doesn't release the Android device session, blocking other threads from using it #32511

Open

Description

@Casual76

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Open thread A with device access enabled and an Android device connected via adb (device preview visible)
  2. Ask the agent to do some work that uses the device
  3. Let the agent finish without explicitly stopping the device session
  4. Settle thread A
  5. Open thread B and try to use the same device

Expected behavior

Settling a thread releases its device session, so other threads can use the device right away

Actual behavior

The device stays held by the settled thread. Thread B can't use it until I find thread A, reopen it, and ask the agent to stop using the device. Since agents often finish without stopping the session, this happens a lot whenever I work across multiple threads

Impact

Major degradation or frequent failure

Version or commit

0.1.8-nightly.20261107.4314

Environment

Windows 11, codex gpt 6.1 sol

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Find the settled thread that holds the device and ask its agent to stop using the device

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Nov 7, 2026
  2. diflores commented on Nov 17, 2026

    @diflores

    Reproduced on macOS with iOS Simulators, which may unblock #32524 (its pipeline stopped because it could only try Android over adb).

    Version: T3 Code Desktop 0.1.10-nightly.20261116.4787, local device host, agent-device daemon 0.21.36, macOS 26.6 arm64. Settle cleanup on main still has no device release (ThreadSettlementService.ts), so this is current.

    Timeline (UTC, 2026-11-17), one Claude thread:

    • 19:08–19:16: device_open on three simulators: iPhone 17 iOS 26.3 (session A), iPhone 17 iOS 26.2 (session B), and a third one (session C).
    • 19:10:41 and 19:17:54: device_close (with shutdown: true) released session A once (then the agent reopened it) and session C. agent-device logged Closed t3-… for each, so device_close itself works.
    • 19:19:50: the thread settled. It never called device_close for A (after the reopen) or B, and agent-device logged no close for either at settle.
    • 19:37–19:51: other threads failed open with DEVICE_IN_USE: Device is already in use by session "t3-…". The claims were held for about 20–30 minutes, until a manual agent-device close --session t3-… from another thread.

    Side note: one manual close failed with INVALID_ARGS because it reused the other simulator's --udid (Session "t3-…" is already bound to apple device …, but close selected --udid=…). The agent-device CLI then printed only its hint, so the close looked like it had succeeded. That's caller error, but the output is easy to misread.

    Evidence: agent-device session events.ndjson and request logs, plus the thread's provider event log. Excerpts are available on request.


    Investigated by Claude Opus 5.5 (claude-opus-5-5) via Claude Code, running inside T3 Code triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions