fix(android): record the instrumentation result when the snapshot helper exits without output

TH
12h ago
+1327-31

Summary

When the Android snapshot helper exits without parseable output, the error and request log carry a typed instrumentation detail (#4005): exit status and signal, result and status codes, INSTRUMENTATION_ABORTED, the INSTRUMENTATION_FAILED component, and capped shortMsg/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.

  • The failure message, stderr detail and helper-bearing errors are as on main; they only gain instrumentation. Stderr hardening is out of scope (#4026).
  • Raw stdout, which carried payloadBase64, is no longer attached to capture errors or executor timeouts.
  • Session exits before and after ready are recorded once streams close, with a bounded drain. Retirement is unchanged.
  • The host signal reaches ExecResult from the foreground executors.
  • No retry or fallback change. #4007 overlap: one hunk in the session lifecycle.

Refs #4005 (diagnostics, not the fix).

Validation

  • Tests first; each regression failed on the prior head.
  • pnpm check:affected --run --head 5e9942f87c29ce45fa0b88595c08f0a75164a9fc passed, plus provider-integration, eager-closure and scoped coverage (100%).
  • Device (emulator-5554): a force-stopped helper reports shortMsg="Process crashed." on the session-exit, fallback and one-shot paths, with no payloadBase64, <node or text=" in errors or logs. See the comment.

🤖 Generated with Claude Code