Skip to content

fix: cache Android snapshot helper installs#470

Merged
thymikee merged 1 commit intomainfrom
fix/android-helper-install-cache
Apr 28, 2026
Merged

fix: cache Android snapshot helper installs#470
thymikee merged 1 commit intomainfrom
fix/android-helper-install-cache

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

@thymikee thymikee commented Apr 28, 2026

Summary

Cache successful Android snapshot helper install checks per device/helper version so repeated helper-backed snapshots skip the package version probe.
Add a release-mode Android APK helper smoke that packages the helper before emulator startup, installs a generated release app, captures via the helper backend, and runs inside the existing Android emulator CI step.

Touched files: 7. Scope stayed within the Android snapshot helper path plus Android CI smoke coverage. Docs/skills were not updated because the CLI/API behavior is unchanged; this is an internal performance/reliability improvement and CI coverage addition.

Closes #455. Secondary-display investigation moved to #471. Toast capture/buffering is intentionally deferred until a real missed-toast workflow needs transient UI event support.

Validation

  • pnpm exec vitest run src/platforms/android/__tests__/snapshot-helper.test.ts src/platforms/android/__tests__/snapshot.test.ts
  • pnpm format
  • pnpm check:quick
  • pnpm check:tooling
  • pnpm package:android-snapshot-helper:npm
  • sh -n test/scripts/android-snapshot-helper-release-smoke.sh
  • sh ./test/scripts/android-snapshot-helper-release-smoke.sh
  • pnpm exec vitest run --maxWorkers=4 && pnpm test:smoke

Known note: an unbounded pnpm check:unit rerun was killed locally by the OS during Vitest; the same unit/smoke bundle passed earlier, and the final bounded Vitest run plus smoke tests passed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.8.1

QR code for preview link

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

Built to branch gh-pages at 2026-04-28 21:41 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: 7ebb5c8fac

ℹ️ 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 on lines +34 to +37
installCacheKey &&
installPolicy !== 'always' &&
installedSnapshotHelpers.has(installCacheKey)
) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Revalidate cached helper install before skipping probe

The new fast-path returns reason: 'current' solely from the in-memory cache, so a reused device ID (for example after emulator restart) or an external uninstall can leave a stale entry that suppresses cmd package list and reinstall checks. In that case this call reports the helper as current even though it is absent, and snapshotAndroid will drop to the stock backend on that capture instead of using the helper path. Consider validating cache entries on reconnect/session boundaries or retrying install once before fallback when helper invocation fails.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the fix/android-helper-install-cache branch from 7ebb5c8 to 3ddb5bc Compare April 28, 2026 21:38
@thymikee thymikee force-pushed the fix/android-helper-install-cache branch from 3ddb5bc to 9b518f1 Compare April 28, 2026 21:41
@thymikee thymikee merged commit 3fee9d6 into main Apr 28, 2026
18 checks passed
@thymikee thymikee deleted the fix/android-helper-install-cache branch April 28, 2026 22:29
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.

Follow up Android snapshot helper reliability and performance

1 participant