Skip to content

fix(app): a published build must not go looking for localhost - #27

Merged
WWStoryMode merged 1 commit into
mainfrom
fix/no-localhost-probe-when-published
Sep 12, 2026
Merged

WWStoryMode merged 1 commit into
mainfrom
fix/no-localhost-probe-when-published

Conversation

@WWStoryMode

Copy link
Copy Markdown
Owner

Opening the deployed instrument raises Chrome's local-network prompt:

wwstorymode.github.io wants to — Access other apps and services on this device

Because the page probes http://localhost:8000/health at boot to fill the model list, and a public origin reaching a private address is now gated behind that dialogue.

Why this is worse than the failure it was guarding

I predicted that fetch would "fail honestly." It does — eventually. But first it asks every visitor for a permission that sounds alarming, has nothing to do with what they came for, and whose answer was going to be "there is no service" either way.

Asking is worse than failing. A page on the open web should not reach for something on your machine unprompted.

The fix

Local builds are unchanged. Served from the machine the service runs on — a dev server, or a file:// page — it probes exactly as before. That is the instrument in normal use.

Published builds stay quiet unless someone asks with ?service. That puts the browser prompt after a question the visitor actually asked, rather than before one they didn't.

Both routes are closed, not just the boot probe. post() refuses before the fetch, so pressing Generate on a published copy explains itself instead of requesting permission to fail. It is the single path drafting, baking and the triptych all go through.

?service takes an optional port, digits only. It decides what the page connects to, so an arbitrary address there would be a link somebody else could aim — the same reasoning that constrains sessionUrl().

What a visitor sees now

local "No motion service is running" + the command to start it
published "This is a published copy… Import a session file — or open one by link — and it plays with nothing loaded at all; the motions are inside the file." + how to connect if you do have the stack

The landing page says the same, and says why it doesn't look.

Verified

The built bundle, served under a real /BodyPrompt prefix: no localhost reference is reachable at boot, and the guard is present in the shipped JS.

npm test 78 passing, tsc --noEmit and vite build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_014yJSPiRjB5WvTH2x4LB8V6

Opening the deployed instrument raised Chrome's local-network prompt --
"wwstorymode.github.io wants to access other apps and services on this
device" -- because the page probes http://localhost:8000/health at boot
to fill the model list.

I predicted that fetch would fail honestly. It does, eventually, but
first it asks every visitor for a permission that sounds alarming, has
nothing to do with what they came for, and whose answer was going to be
"there is no service" either way. Asking is worse than the failure.

A build served from the machine the service runs on -- a dev server, or
a file:// page -- still probes exactly as before; that is the instrument
in normal use. A build served from the open web stays quiet unless
someone asks with ?service, which puts the prompt after a question the
visitor actually asked rather than before one.

Both routes to the service are closed, not just the boot probe. post()
refuses before the fetch, so pressing Generate on a published copy
explains itself instead of requesting permission to fail -- it is the
single path drafting, baking and the triptych all go through.

?service takes an optional port, digits only. It decides what the page
connects to, so an arbitrary address there would be a link someone else
could aim -- the same reasoning as sessionUrl().

The hint now distinguishes the two cases: a local build says the service
is not running and gives the command to start it; a published one says
it has no service behind it, that importing works with nothing loaded,
and how to connect if you do have the stack. The landing page says the
same.

Verified on the built bundle served under a /BodyPrompt prefix: no
localhost reference is reachable at boot.

npm test 78 passing; tsc and vite build clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yJSPiRjB5WvTH2x4LB8V6
@WWStoryMode
WWStoryMode merged commit fc978d0 into main Sep 12, 2026
2 checks passed
@WWStoryMode
WWStoryMode deleted the fix/no-localhost-probe-when-published branch September 12, 2026 10:43
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