Skip to content

fix(whatsapp): the emulator script takes --host, for a demo on a phone over the local network - #109

Closed
rapguit wants to merge 2 commits into
mainfrom
fix/whatsapp-emulator-host
Closed

rapguit wants to merge 2 commits into
mainfrom
fix/whatsapp-emulator-host

Conversation

@rapguit

@rapguit rapguit commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

  • scripts/whatsapp-emulator.mjs passes --host <addr> to dyvit-wa-sim serve. The default stays 127.0.0.1; --host without a value exits 2. The startup line prints the address.
  • agents/topup-agent/runbook.md gains "On a phone": the emulator and the simulator's web app on every interface, the PC's address, the emulator URL to type in the simulator's live mode, a firewall note and a CORS check.

Why

The topup-agent demo will run with the conversation on an Android phone, reaching the PC over the local network. The phone's browser talks to the emulator directly, so the emulator has to listen beyond loopback.

What it does not change

  • EMULATOR_VERSION stays 0.3.0. The cta_url rendering fix in the simulator is after 0.3.0 and unpublished; the bump is its own PR when 0.3.1 exists.
  • The webhook stays on 127.0.0.1:4399, and the agent still talks to http://127.0.0.1:4290.

Checked

  • Published 0.3.0 accepts --host (dist/cli.js in the npx cache) and sends access-control-allow-origin: * on every response; with --host 0.0.0.0, a request to the LAN address with a foreign Origin got the CORS headers, the preflight answered 204, and the process group stopped cleanly afterwards.
  • npm run check, npm run eval --workspace=agents/topup-agent, npm run typecheck, npm test (97 files passed, 3 skipped), node scripts/secret-scan.mjs: all green.

Risk

With --host 0.0.0.0 anybody on the network can read and post into the simulated conversations (CORS *, development app secret). The runbook says: trusted network only, stop it when the demo ends. Nothing real flows through the emulator.

🤖 Generated with Claude Code

…e over the local network

scripts/whatsapp-emulator.mjs passes --host to `dyvit-wa-sim serve` (the
published 0.3.0 already accepts it). The default stays 127.0.0.1: the
emulator answers every origin with a development app secret, so binding
every interface is a choice made for a demo on a trusted network. The
webhook stays on 127.0.0.1. The topup-agent runbook gains "On a phone":
the simulator page and the emulator on the PC's address, the URL to type
in the simulator's live mode, and a CORS check. EMULATOR_VERSION is not
bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rapguit
rapguit force-pushed the fix/whatsapp-emulator-host branch from 35c894f to d6582db Compare November 3, 2026 16:58
rapguit added a commit that referenced this pull request Nov 11, 2026
…t links kept off the log and off disk (#109, #110, #130) (#134)

One squash of the release branch.

- #109: the WhatsApp emulator script takes --host.
- #110: a pull may hand the payer two consent pages in one attempt (consent_step); consent links are redacted in channel.jsonl.
- #130: a hosted consent link is not kept in stub_rail_attempts or the sweeping record.
- Comment cleanup in the topup-agent's sweeping client and rail.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@rapguit

rapguit commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main via #134.

@rapguit rapguit closed this Nov 11, 2026
@rapguit
rapguit deleted the fix/whatsapp-emulator-host branch November 12, 2026 22:21
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