Skip to content

fix(remote): client-serving robustness — per-request bundle check, cache headers, self-diagnosing fallback - #431

Merged
Juliusolsson05 merged 2 commits into
mainfrom
fix/remote-client-lazy-dist
Jul 7, 2026
Merged

Juliusolsson05 merged 2 commits into
mainfrom
fix/remote-client-lazy-dist

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Found in first real-world smoke test (#420): scanning the QR before running npm run client:build showed the placeholder, and building afterwards changed nothing until a full app restart, because main existence-checked the dist dir once at boot.

Now the path passes through unconditionally and serveClient checks index.html per request — build, reload the phone page, done. The placeholder copy names the exact command instead of a dead end.

Verified: node tsc clean, 76 remote tests green.

🤖 Generated with Claude Code

Juliusolsson05 and others added 2 commits July 6, 2026 23:57
The construction-time existsSync gate meant building the client bundle
after app launch never took effect (placeholder until full restart) and
the placeholder didn't say what to do — the first thing real-world
testing tripped on. The dist path now passes through unconditionally and
serveClient checks index.html on each request, so 'npm run client:build'
then reloading the phone page just works; the placeholder now names the
exact command.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Field-debugging fallout: a phone kept rendering a stale page through a
rebuild AND an app restart because serveClient sent no cache headers, and
mobile browsers cache heuristically-forever without them. index.html (and
the placeholder/SPA fallback) now send no-cache so every load revalidates;
Vite's content-hashed assets get max-age=1y immutable — a new build
changes the hash and the revalidated index points at it.

Second half of the same incident: when backfill fails, the client's
raw-TUI fallback is visually identical to the pre-semantic-rendering UI,
so a broken pipeline masquerades as 'nothing changed'. The store now
records non-benign backfill errors and SessionView says WHY it is showing
raw terminal instead of the rich feed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 force-pushed the fix/remote-client-lazy-dist branch from 20d5942 to 43bc04c Compare July 6, 2026 22:11
@Juliusolsson05 Juliusolsson05 changed the title fix(remote): serve phone bundle built after app launch (per-request check) fix(remote): client-serving robustness — per-request bundle check, cache headers, self-diagnosing fallback Jul 6, 2026
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Rebased on main (post-#438) and expanded from field debugging: mobile-browser caching served a stale page through a rebuild AND an app restart because we sent no cache headers — now no-cache on HTML, immutable on hashed assets. Also: the raw-TUI fallback now explains itself when backfill fails instead of silently impersonating the old UI. 83 remote tests green, both tsc projects clean.

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