Skip to content

feat: add Metro reload command#440

Merged
thymikee merged 1 commit intomainfrom
feat/metro-reload
Apr 25, 2026
Merged

feat: add Metro reload command#440
thymikee merged 1 commit intomainfrom
feat/metro-reload

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

Summary

Add agent-device metro reload, which calls Metro's /reload endpoint to reload connected React Native apps without restarting the native process.

Expose the reload path through the typed client and agent-device/metro, share runtime transport parsing for host/port/bundle URL handling, and update docs plus agent-device skills so agents prefer Metro reload for JS-only dev loops.

Touched files: 19. Scope stayed within Metro command/API, runtime hint parsing, tests, docs, and skills.

Validation

  • pnpm format
  • pnpm check:quick
  • pnpm test:unit src/__tests__/client-metro.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts src/__tests__/metro-public.test.ts src/daemon/__tests__/runtime-hints.test.ts
  • pnpm test:unit src/__tests__/client-metro.test.ts src/__tests__/metro-public.test.ts

@thymikee thymikee force-pushed the feat/metro-reload branch from 8bbc0b5 to bfe2ab5 Compare April 25, 2026 23:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2026

PR Preview Action v1.8.1

QR code for preview link

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

Built to branch gh-pages at 2026-04-25 23:19 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: bfe2ab5a3d

ℹ️ 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/client-metro.ts Outdated
Comment on lines +276 to +279
const url = new URL(`${transport.scheme}://metro.invalid/reload`);
url.hostname = transport.host;
url.port = String(transport.port);
return url.toString();
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 Preserve runtime route prefix for Metro reload

Building the reload endpoint from only transport.host/transport.port forces every request to /<code>reload</code> at the origin root, which breaks bridged runtimes whose saved bundleUrl includes a required path prefix (for example Android hints like /api/metro/runtimes/<id>/index.bundle). In that common remote-tenancy case, this code drops the runtime identifier and sends reload to the wrong route, so metro reload can fail with 404 or target the wrong runtime; derive the reload URL from the bundle URL path instead of hardcoding root /reload.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the feat/metro-reload branch from bfe2ab5 to 41895ce Compare April 25, 2026 23:08
@thymikee thymikee force-pushed the feat/metro-reload branch from 41895ce to d71ef1c Compare April 25, 2026 23:19
@thymikee thymikee merged commit 4ddd29c into main Apr 25, 2026
15 checks passed
@thymikee thymikee deleted the feat/metro-reload branch April 25, 2026 23:30
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