software-mansion / software-mansion/argent

ANDROID_ADB_COMMAND_FAILED records failure_command as the fixed label "adb", so 22k events a fortnight cannot be split by which adb call failed

Open
#1,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.9k
Forks
118
Avg merge
1d 19h
Merged PRs (30d)
93

Description

subprocessFailureMetadata (packages/registry/src/errors.ts:160-193) records failure_command as a fixed enum label. Every adb failure argent raises — from describeAdbFailure at packages/tool-server/src/utils/adb.ts:140-151, reached from runAdb / runAdbBinary (adb.ts:183-196) — therefore lands as:

failure_command = "adb"
failure_stage   = "android_adb_command"

ANDROID_ADB_COMMAND_FAILED is 22478 events / 487 users in the last 14 days (non-CI), and all 22478 carry that same pair. The argv is never recorded, so am force-stop is indistinguishable from uiautomator dump, install, wait-for-device or shell getprop in telemetry. The single highest-volume adb failure in the product cannot be split into its causes.

That the wrapper is hiding genuinely different bugs is visible even without the argv, by joining on tool and duration. Excluding three storm users who contribute 87% of the raw volume, the remaining ~450 users look like this:

tool events users median duration
describe 994 137 35529 ms
launch-app 339 120 30032 ms
restart-app 186 73 30494 ms
reinstall-app 139 17 197315 ms
keyboard 85 31 18245 ms

Those cluster on the per-command adb budgets — they are timeouts, not adb errors — while the storm users' failures are ~90ms device not found shapes. One code, two unrelated populations.

Suggested direction

Carry the adb subcommand in failure_command (shell:am-start, exec-out:uiautomator, install, wait-for-device, …). It is argent's own argv, not user input, so it fits the existing "fixed vocabulary" contract in Telemetry.md.

Separately worth splitting out: isTerminalAdbError / TERMINAL_ADB_ERROR_PATTERNS already exist at adb.ts:544-559 but are wired only into waitForBootCompleted and settings-permissions. Routing describeAdbFailure through them and emitting a distinct "device is gone, call list-devices / boot-device" code would have turned 8844 identical 90ms failures in one 12-hour session into one actionable message.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read subprocessFailureMetadata in packages/registry/src/errors.ts:160-193 and the adb flow in packages/tool-server/src/utils/adb.ts, especially describeAdbFailure, runAdb, runAdbBinary, and the terminal-error helpers at lines 544-559. Check Telemetry.md for the fixed-vocabulary contract and existing telemetry tests or validation. Done means adb failures can be distinguished by subcommand, with any terminal-device error split according to the agreed scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.