Skip to content

Android/ColorOS: OplusHans freezes the persistent snapshot helper after idle, causing daemon_transport_timeout instead of one-shot fallback #3929

Closed

Description

@YouAreOK

Summary

On a physical OPPO device running ColorOS 16 / Android 16, the persistent
Android snapshot helper is frozen by ColorOS OplusHans/OFreezer after being
idle for tens of seconds.

The initial snapshot succeeds. After waiting 50 seconds, the next snapshot
fails with daemon_transport_timeout.

Forcing the snapshot helper into one-shot instrumentation mode avoids the
problem.

This reproduces with the current public npm release, agent-device@0.21.31.

This is different from #2364:

  • The helper installs successfully.
  • The first persistent snapshot is healthy.
  • The failure happens later, when ColorOS freezes the already-running helper.
  • There is no INSTALL_FAILED_TEST_ONLY or vendor install error -99.

Environment

Component Value
agent-device 0.21.31, fetched directly from registry.npmjs.org
Host Windows 11 Enterprise LTSC, build 26100
Node.js 24.22.0
npm 11.9.0
adb 1.0.41 / platform-tools 37.0.1
Device OPPO PGT110 physical device over USB
Android 16
ColorOS V16.0.0
Snapshot helper 0.21.31

The screen was on and unlocked. adb devices -l continued to report the
device as device.

Minimal reproduction

PowerShell:

$env:npm_config_registry = 'https://registry.npmjs.org/'
$env:AGENT_DEVICE_STATE_DIR = "$PWD\.agent-device-coloros-repro"

npx --yes --package agent-device@0.21.31 agent-device open <APP_PACKAGE> `
  --platform android `
  --session coloros-freeze-repro `
  --foreground `
  --json

Start-Sleep -Seconds 50

npx --yes --package agent-device@0.21.31 agent-device snapshot `
  -i `
  -d 0 `
  --session coloros-freeze-repro `
  --timeout 10000 `
  --json

Activity

  1. added
    bug
    needs-info
    on Oct 24, 2026
  2. thymikee commented on Oct 24, 2026

    @thymikee
    Member

    Triage: bug, needs one more data point. When a persistent-session request times out, the helper is meant to fall back to a one-shot capture within the same request, but your --timeout 10000 may not leave room for that fallback. Please run the failing snapshot once more and attach:

    • the output with --debug, plus the request log it names
    • whether the same repro without --timeout 10000 still fails
  3. YouAreOK commented on Oct 26, 2026

    @YouAreOK
    Author

    Thanks — I reran the comparison with agent-device@0.21.31 on the same OPPO PGT110 / ColorOS 16 device.

    I used com.android.settings, a fresh state directory and session for each run, and waited 50 seconds after the initial successful snapshot. AGENT_DEVICE_ANDROID_SNAPSHOT_HELPER_SESSION was unset in both runs.

    A. With --timeout 10000

    The snapshot failed after 10,013 ms with:

    • reason: daemon_transport_timeout
    • requestId: 099e3e001db71f8c
    • message: Daemon request timed out

    This confirms that the 10-second request budget expires before recovery can complete.

    B. Without an explicit --timeout

    The same fresh-session reproduction still failed. The request ran for 58,369 ms:

    • requestId: 55f356bbcdfebd44
    • message: Android snapshot helper failed: adb timed out after 30000ms

    The request log confirms that fallback was attempted:

    • android_snapshot_helper_session_fallback
    • reason: Android snapshot helper session request timed out

    The persistent helper could not be cleanly retired:

    • quitAcknowledged: false
    • quitExitObserved: false
    • release: unknown
    • forceKilled: true
    • externalCleanupTimedOut: true

    The fallback then invoked a one-shot capture through:

    adb shell am instrument -w ... com.callstack.agentdevice.snapshothelper/.SnapshotInstrumentation

    That command also timed out after 30,000 ms.

    So the explicit 10-second timeout is not the only issue. Without it, agent-device reaches the intended one-shot fallback, but the fallback cannot recover after ColorOS has frozen the persistent helper.

    An additional observation: after the first failed reproduction, adb devices -l still reported the device as device, while a new adb shell getprop command hung. Restarting/reconnecting ADB restored shell commands before the clean B run. After the B failure, adb devices -l again continued to report the device as device.

    I have attached:

    • a-timeout-10s-debug-output.txt
    • a-cli-diagnostic.ndjson
    • a-request-099e3e001db71f8c.ndjson
    • b-default-timeout-debug-output.txt
    • b-request-55f356bbcdfebd44.ndjson
      agent-device-coloros-ab-evidence.zip
  4. removed
    needs-info
    on Oct 26, 2026
  5. thymikee commented on Oct 26, 2026

    @thymikee
    Member

    Thanks, run B settles it: the one-shot fallback does run after the session request times out, but adb shell on the device is frozen too, so the fallback cannot recover either. This is the device stalling, not a missing fallback. Maintainers will decide how a device whose persistent helper froze once should be handled for the rest of the daemon's life; this stays parked until then. Until then, your one-shot setting from the start is the workaround.

  6. YouAreOK commented on Oct 27, 2026

    @YouAreOK
    Author

    Thanks

  7. mvanhorn commented on Oct 28, 2026

    @mvanhorn
    Contributor

    A failed helper retirement can leave the release state unproven or cleanup timed out, indicating that the device may still be affected by the frozen helper. The lifecycle did not previously remember that device-specific condition, so later requests could retry persistent sessions.

    Track unhealthy devices for the daemon runtime when forced retirement cannot prove release or cleanup times out.

    #4007

  8. added a commit that references this issue on Oct 30, 2026
    f9a1dab
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions