You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: snapshot helper exits without parseable output after a screen transition (still on 0.21.33) #4005
On an Android emulator in CI, snapshot intermittently fails because the snapshot helper exits without returning parseable output. The client gets COMMAND_FAILED with details.androidSnapshotHelperFailureReason: "Android snapshot helper failed before returning parseable output". It reproduces on 0.21.28 and 0.21.33, so the vanished-child fix in #3901 (0.21.31) did not remove it for us.
Environment
Emulator: system-images;android-36;google_atd;x86_64 (API 36, Google ATD), in CI
Driven through @e2e-dev/mobile 0.12.4 (persistent snapshot-helper session, then the one-shot am instrument fallback)
App: React Native (Expo)
Run
agent-device
Helper versionCode
Result
A
0.21.28
21028
helper exit after 629 ms
B
0.21.28
21028
session returned truncated XML → force-kill → one-shot fallback exits after 947 ms
Frequency: an A/B over the same suite gave 1 failing run of 5 on 0.21.33 and 1 of 3 on 0.21.28.
Repro shape
In the 0.21.33 failure, the step was an assertion polling snapshots right after a screen transition (a peer mention opened from the notifications list). Failure is intermittent, and the request logs also show it on repeated snapshots.
android_snapshot_helper_session_stop: forceKilled=true
android_snapshot_helper_session_fallback: "Android snapshot helper session returned truncated XML"
android_snapshot_helper_capture durationMs=947: failed before returning parseable output
request_failed code=COMMAND_FAILED
Run C, 0.21.33 (two requests):
helper version=0.21.33; versionCode=21033
persistent-session answered=false; instrumentation fallback failed
capture durations: 1022 ms and 602 ms
reason: Android snapshot helper failed before returning parseable output
request_failed code=COMMAND_FAILED
Logcat:
In run C, the Android automation logcat shows Force stopping com.callstack.agentdevice.snapshothelper ...: start instr, then the process start and UiAutomation: Initialized. No FATAL EXCEPTION, AndroidRuntime or NullPointerException line follows.
The adb logcat -d -b crash dump taken after the suite is empty (run C; runs A/B predate that dump).
So the artifacts show the helper exiting, but not an in-process exception.
Asks
Is there a helper-side log, or a flag such as --debug, that would record why the instrumentation exited (exit code, instrumentation result bundle, a INSTRUMENTATION_ABORTED / shortMsg)? Our host only records "failed before returning parseable output".
Could the one-shot fallback be retried once by agent-device itself when the persistent session has just been force-killed? In our logs, both paths fail inside the same ~1 s window right after a transition.
Related: #3901 (vanished-child NPE, 0.21.31), #3929 (persistent helper frozen on ColorOS; a different symptom).
Triage: bug. Thanks, the three runs and the empty crash buffer narrow it. On your asks:
Not today. The failure records only "failed before returning parseable output". The first fix records the instrumentation's own result (exit status, INSTRUMENTATION_ABORTED or shortMsg, and the output tail) in the error details and the request log.
No blind retry. Both paths fail inside the same second, so a retry would hide the cause rather than fix it. Once the result is visible, the fix goes to the owner it names.
#4021 shipped in 0.21.34: when the helper exits without parseable output, the error now carries the instrumentation result (status code and shortMsg), and the request log records it. Please rerun on 0.21.35 and, when it fails again, post the error's details. That tells us whether this is the same early exit as #4109 or a crash inside the helper.
Follow-up: #4021 shipped the instrumentation exit diagnostics in 0.21.34. Closing after fourteen days without the requested current-version error details; this does not establish that the underlying helper exit is fixed. Reopen with those details if it recurs. No blind retry was added.
Activity
thymikee commentedon Oct 28, 2026
Triage: bug. Thanks, the three runs and the empty crash buffer narrow it. On your asks:
INSTRUMENTATION_ABORTEDorshortMsg, and the output tail) in the error details and the request log.An agent can pick up the diagnostics part.
thymikee commentedon Oct 28, 2026
An agent is working on this now; the PR will link here.
fix(android): keep snapshot content out of the helper exit diagnostic…
fix(android): filter snapshot content before cutting the tail, and re…
fix(android): match only UiAutomator attributes as snapshot content a…
refactor(android): keep only allowlisted instrumentation fields and a…
refactor(android): record parsed instrumentation fields only, drop th…
fix(android): keep the helper failure message and stderr detail as be…
fix(android): withhold message fields with a generic fail-closed rule
fix(android): record the instrumentation result when the snapshot hel…
thymikee commentedon Oct 31, 2026
#4021 shipped in 0.21.34: when the helper exits without parseable output, the error now carries the instrumentation result (status code and
shortMsg), and the request log records it. Please rerun on 0.21.35 and, when it fails again, post the error's details. That tells us whether this is the same early exit as #4109 or a crash inside the helper.thymikee commentedon Nov 14, 2026
Follow-up: #4021 shipped the instrumentation exit diagnostics in 0.21.34. Closing after fourteen days without the requested current-version error details; this does not establish that the underlying helper exit is fixed. Reopen with those details if it recurs. No blind retry was added.