Skip to content

fix(android): ignore emulator log lines in -list-avds output - #3743

Open
airowe wants to merge 3 commits into
callstack:mainfrom
airowe:fix/android-avd-list-banner
Open

airowe wants to merge 3 commits into
callstack:mainfrom
airowe:fix/android-avd-list-banner

Conversation

@airowe

@airowe airowe commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

agent-device devices listed a phantom stopped emulator whose id and name were the emulator's crashdata banner (INFO | Storing crashdata in: …). emulator -list-avds prints that line on stdout with exit 0, and parseAndroidAvdList accepted every non-empty line.

The parser now keeps only lines made of the characters avdmanager allows in AVD names (A-Z a-z 0-9 . _ -). That rejects emulator logging without matching its text. 2 files changed. Fixes #3716.

Validation

Base 0149438fa, head b0277a7. New inventory.test.ts cases feed the real banner alone, and beside AVD names with CRLF line endings. Both fail on base with the banner listed as a device, and pass at head.

pnpm check:affected --run --head b0277a7 (exactCommit: true): format and lint passed. Typecheck failed at test/integration/command-coverage/declarations.ts:558 (linux.gap). That failure is inherited from main and fixed by #3740. Because the runner stops there, I ran the remaining stages separately on the same diff. Layering, fallow, build and provider-integration passed. Unit passed, including every platform-android test. The only unit failures were unrelated: a parallel-load timeout that passes alone, path-with-space failures in fuzz/webdriver tests that pass from a path without a space, and smoke hitting the same linux.gap error. scripts/__tests__/eager-closure-budgets.test.ts passed.

No live device run: this is a host-side stdout parser, and the evidence is unit tests on the real banner at the discovery boundary. Coverage and integration are left to CI.

View guided diff

`emulator -list-avds` can print its crashdata INFO banner on stdout with
exit code 0. The inventory treated every non-empty stdout line as an AVD,
so a machine with zero AVDs listed a phantom emulator named after the
banner. Accept only lines matching avdmanager's AVD-name grammar.

Fixes callstack#3716

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Re-trigger cubic

@thymikee

Copy link
Copy Markdown
Member

The PR is ready at b0277a7. The parser change looks right, and the new tests feed the real emulator banner through the inventory boundary.

Not blocking: there is no direct parser-level case for the name shape rule in packages/platform-android/src/inventory-parsers.test.ts (https://github.com/callstack/agent-device/blob/b0277a7/packages/platform-android/src/inventory-parsers.test.ts#L27), so one parseAndroidAvdList case that mixes the banner with valid names would pin it, and you can take or leave that.

CI is red, but the failures look unrelated. Typecheck fails at test/integration/command-coverage/declarations.ts:558 (linux.gap missing), and Smoke, Integration and Repo Guards fail with TypeError: linux.gap is not a function while importing that same file. #3740 fixes this and the branch is on an old base. This diff only touches Android parsing and one test, and none of the failing jobs reach that code.

I did not run the new tests or the gates, and I did not run a live emulator. I also did not check the AVD name character set against avdmanager source, so that rule rests on the PR's claim. A hand-edited AVD ini with a space in its name would now be hidden, which seems unlikely.

Please rebase onto main so the #3740 fix lands, then rerun CI. That is the only step left before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 16, 2026
@airowe

airowe commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I took the parser note: 39478b4 adds a parseAndroidAvdList case in inventory-parsers.test.ts that mixes the crashdata banner and a WARNING | line with Pixel_9_Pro_XL and wear-os.36 (CRLF). It fails if the filter is reverted to "any non-empty line".

Instead of rebasing, I merged main in (dce0b7a), which brings in #3740 without a force-push. pnpm check:affected --run --head dce0b7a passes with exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related. Coverage is left to CI.

@thymikee

Copy link
Copy Markdown
Member

The code looks good at dce0b7a. The earlier review at b0277a7 was also clean, and nothing new needs fixing.

All 11 checks pass. The diff only touches Android inventory parsing and its tests, and there are no conflicts.

I did not run the tests locally or run an emulator. The change filters stdout in -list-avds parsing, and the parser and inventory tests cover it, so live evidence is not needed. There are no open or resolved threads on this PR. Nothing else must happen before a human decides to merge.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

devices reports a phantom Android emulator named after the emulator's crashdata INFO banner

2 participants