Skip to content

fix: handle busy Android RN snapshots#554

Merged
thymikee merged 1 commit into
mainfrom
fix/android-rn-busy-snapshots
May 16, 2026
Merged

fix: handle busy Android RN snapshots#554
thymikee merged 1 commit into
mainfrom
fix/android-rn-busy-snapshots

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented May 15, 2026

Summary

Fail Android snapshot helper captures fast when the accessibility tree is busy, while giving the host adb instrumentation call enough overhead on slower CI emulators. The helper capture budget is 5s and the host command budget is 8s.

Detect React Native warning banners and RedBox overlays in snapshot output so agents expand collapsed warnings, prefer Minimize when present, and avoid pressing Dismiss on RedBox stacks when Minimize is unavailable.

Host-side adb instrumentation timeouts now fall back to stock UIAutomator instead of being treated as busy-tree signals.

Touched files: 7. Scope stayed within Android snapshot handling, snapshot overlay warnings, versioned help, and focused tests.

Validation

Focused Android snapshot and runtime snapshot tests passed: 43 tests.

pnpm check:fallow --base origin/main passed.

pnpm check:quick passed.

pnpm build passed before the final cleanup; the final cleanup narrowed matchers, simplified helper timeout handling, and removed redundant tests.

SkillGym cases passed before cleanup: rn-redbox-stack-minimize-before-continuing 2/2 and rn-collapsed-warning-banner-expand-dismiss 2/2. After cleanup, a non-escalated rerun crashed both model runners before assertions; no code/test assertion failed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-554/

Built to branch gh-pages at 2026-05-16 12:24 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38696531e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/platforms/android/snapshot.ts Outdated
Comment on lines +43 to +44
const HELPER_CAPTURE_TIMEOUT_MS = 4_000;
const HELPER_COMMAND_TIMEOUT_MS = 5_000;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore command timeout headroom

On slower devices or on the first helper invocation after install, am instrument -w can spend more than the 1 second gap between the 4s helper deadline and this 5s adb deadline in instrumentation startup/teardown before the helper can return its structured timeout result. Since isAndroidSnapshotHelperBusyError also treats any adb timeout whose args include instrument as a busy-tree failure, those cases now fail the snapshot and skip the stock UIAutomator fallback even when the accessibility tree itself is healthy. Please keep enough command-level headroom, or avoid classifying adb-level instrumentation startup timeouts as busy, so fallback can still run.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the fix/android-rn-busy-snapshots branch 5 times, most recently from 5b936d8 to ade1c81 Compare May 16, 2026 11:47
@thymikee thymikee force-pushed the fix/android-rn-busy-snapshots branch from ade1c81 to e5c72e9 Compare May 16, 2026 12:23
@thymikee thymikee merged commit b5cd1c4 into main May 16, 2026
18 checks passed
@thymikee thymikee deleted the fix/android-rn-busy-snapshots branch May 16, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant