Repository navigation
fix(android): record the instrumentation result when the snapshot helper exits without output - #4021
Conversation
…per exits without output Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Size Report
Startup median (7 runs, lower is better):
|
…s and keep the real cause Strip encoded payloads and raw XML before the output tail is built, keep the last 400 characters after redaction, read multiline and startup-failure records, record exits after the session was ready, and carry the host signal through the executor result. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…ad exits after the streams close Treat XML attribute syntax as snapshot content even without its opening tag, read the session exit result after the child's streams close, cap single-line shortMsg/longMsg, accept only safe-integer result codes, and report the signal from every ExecResult producer. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…nd keep long diagnostic lines Fold the exit-result code into instrumentation-helper.ts so the eager closure does not grow. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
I reviewed 9eddef3 by reading the code. I did not run tests, and I had no emulator. The change does not look ready yet, for two reasons. The failure path gets slower, and there is no live device evidence. In snapshot-helper-session.ts:79, any failed session request whose helper is still alive now waits the full The PR changes the live session lifecycle: new stream listeners on the session child, an awaited drain in stop, and a wait before retire (snapshot-helper-session-lifecycle.ts:474). It ships only hand-written AOSP fixtures, and the body says no device run was done. Please run on an Android emulator with a persistent session open. First, kill the helper mid-session with The cubic-dev-ai P1 thread on one shared line buffer for stdout and stderr still stands: #4021 (comment). One P3 thread on a dropped oversized line also still applies. The other P3 thread, on the wording of the Production code grows by about 336 lines across host-kit, kernel and platform-android. Could the change be smaller? Keep Not blocking, and fine to take or leave: CI is still pending. All 13 remaining checks are queued or in progress on 9eddef3, and none has failed. Lint/Typecheck, Coverage and the Android smoke route overlap this diff, so their results matter. Before merge, remove the 250 ms wait from the session failure path, split the shared stdout/stderr buffer, and attach the live emulator run above. |
… filtered stderr tail Stdout is no longer copied: the exit result holds the parsed protocol fields and a bounded stderr tail with one parser state per stream. Drops the stdout tail filter. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ne reader Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…g a cut unbroken stderr line Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…etails Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d snapshot without finalizing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e stderr tail Read startup failures from strict whole-line envelopes, sanitize executor timeouts at the capture boundary, bound the exit drain, and stop delaying live-helper retirement. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…fore, strip only stdout Restore the snapshot helper failure reason and the stderr detail, strip stdout from executor timeouts, share one signal result builder in the foreground executors, and make the live-session retirement test independent of wall-clock time. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…keep helper-bearing errors as on main Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop the attribute list: a message value, or a continuation line, that holds an attribute-like assignment, markup, an entity, a payload record or a cut line is withheld whole and named in withheldFields. The abort message is checked like the others. Refs #4005 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…o one line Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the update. At c97885f the entity matching, the ABORTED record handling and the The PR changes the live persistent-session lifecycle: new stdout/stderr listeners on the session child, a closed-or-250ms drain before the Not blocking, take or leave: in instrumentation-helper.ts#L163 the bare I did not run the tests or any device. I judged the new tests by reading the parser. None of the earlier inline threads still apply, so you can resolve them: the Smoke Tests is still queued, not failed. Its Android route runs |
…kup rule Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Device run on 1. Persistent session killed ( Idle kill, then {"phase":"android_snapshot_helper_session_exited","level":"warn","data":{"deviceKey":"android:emulator-5554","capturedCount":1,"instrumentation":{"exitCode":0,"resultCode":0,"statusCode":2,"shortMsg":"Process crashed."}}}It then logged Kill 150 ms into a snapshot (request in flight): {"phase":"android_snapshot_helper_session_fallback","level":"warn","data":{"reason":"Android snapshot helper session returned malformed output","instrumentation":{"exitCode":null,"resultCode":0,"statusCode":2,"shortMsg":"Process crashed."},"uiAutomationConnectionTimeout":false}}
{"phase":"android_snapshot_helper_capture","durationMs":370,"data":{"transport":"instrumentation"}}The one-shot capture then succeeded. Here the host process had not reported its exit yet ( Finding: I did not instrument the 2. One-shot failure ( The request-log entry carries the same object: {"phase":"android_snapshot_helper_failed","level":"error","data":{"reason":"Android snapshot helper output could not be parsed","instrumentation":{"exitCode":0,"resultCode":0,"shortMsg":"Process crashed."}}}
Real The optional |
|
The review of 5e9942f finds no code problems. Since the earlier review at c97885f, the evidence gap is closed: the author's pasted logs from two real-device runs show the diagnostic fields on a real force-stop, in both the idle and the in-flight path. All 18 checks pass at this commit, and there are no conflicts. The last change is a regex simplification that does not change the matched language, so it cannot change any job result. Nothing else blocks merge. I did not run tests or a device myself. Two limits stay, and neither blocks merge. The closed-or-250 ms drain was not seen on real adb, because no exit-then-close gap appeared, so only the fake-timer tests cover it. The one-shot failure showed exitCode 0 with no crash stack, because a force-stop prints only shortMsg and INSTRUMENTATION_CODE: 0, so real crash-stack and abort shapes are covered only by fixtures. On the earlier threads, all already resolved: the three about the markup regex (#4021 (comment)), the one-line abort message (#4021 (comment)), and the withheldFields doc (#4021 (comment)) are fixed at this commit. The drain-test thread (#4021 (comment)) is fixed too: the test uses fake timers, and the remaining Date.now check is a loose 2 s bound. The three stderr threads (#4021 (comment), #4021 (comment), #4021 (comment)) do not apply: stderr handling is unchanged from main and is tracked in #4026. |
Summary
When the Android snapshot helper exits without parseable output, the error and request log carry a typed
instrumentationdetail (#4005): exit status and signal, result and status codes,INSTRUMENTATION_ABORTED, theINSTRUMENTATION_FAILEDcomponent, and cappedshortMsg/longMsg/Error/stack.Scope cut: private by construction. The detail is parsed protocol fields only, with no free text from either stream. Stdout lines are never copied. A message that looks like snapshot content, or was cut at the line limit, is withheld whole and named in
withheldFields. From stderr, only a strict startup-failure envelope is read.stderrdetail and helper-bearing errors are as on main; they only gaininstrumentation. Stderr hardening is out of scope (Android: helper stderr reaches the client error and request log unfiltered #4026).payloadBase64, is no longer attached to capture errors or executor timeouts.ExecResultfrom the foreground executors.Refs #4005 (diagnostics, not the fix).
Validation
pnpm check:affected --run --head 5e9942f87c29ce45fa0b88595c08f0a75164a9fcpassed, plus provider-integration, eager-closure and scoped coverage (100%).shortMsg="Process crashed."on the session-exit, fallback and one-shot paths, with nopayloadBase64,<nodeortext="in errors or logs. See the comment.🤖 Generated with Claude Code