feat: auto-reverse Android localhost opens#590
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef0e062ad3
ℹ️ 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".
| throw new AppError( | ||
| 'COMMAND_FAILED', | ||
| `Failed to ensure Android port reverse ${endpoint} before opening localhost URL`, | ||
| { |
There was a problem hiding this comment.
Fall back to deep-link launch when reverse ensure fails
This new preflight converts any adb reverse failure into a hard COMMAND_FAILED before am start runs, which means localhost deep links now cannot open at all in environments where reverse is unavailable or flaky (for example bridge/device setups that reject reverse). That regresses behavior because the deep link dispatch itself may still succeed when reverse is already configured externally or not needed by the app, so this should be best-effort instead of aborting the open flow.
Useful? React with 👍 / 👎.
Summary
Android deep-link opens to localhost URLs with a port now ensure the matching
adb reverse tcp:<port> tcp:<port>through the existing Android reverse provider before launch.Updates help/docs and SkillGym guidance so agents rely on automatic handling for direct localhost URL opens while keeping manual
adb reverseguidance for app launches or unsupported flows.Closes #587
Touched files: 6. Scope stayed within Android app lifecycle, tests, and user-facing guidance.
Validation
Verified with targeted Android lifecycle and CLI help tests, quick lint/type checking, formatting, and build:
pnpm formatpnpm exec vitest run src/platforms/android/__tests__/index.test.ts src/utils/__tests__/args.test.tspnpm check:quickpnpm buildgit diff --checkpnpm test:skillgym:case android-local-metro-reverse-before-url-openwas not run because it requires external Codex/Claude runners and explicit authorization for repo-derived prompt transfer.