feat(extension): the live-test reload lane — stamp amicode_build, prompt on new builds (#1556, subsumes #1459) - #1557
Open
aarontrowbridge wants to merge 2 commits into
Open
aarontrowbridge wants to merge 2 commits into
aarontrowbridge wants to merge 2 commits into
Conversation
…pt on new builds (#1556, subsumes #1459) The webview's service worker caches the panel iframe's navigation, so a shipped dist reaches the developer only after hand-clearing the outer webview cache (#1459), and nothing ever prompted that a new build was live. The extension host's fetches bypass that SW, so it always sees the true served origin doc: derive the dist's build id from its index-<hash>.js entry reference and (1) stamp it on the iframe src (amicode_build=<id>, both HTML paths — a new URL the SW has never cached, never disturbing auth_token or any existing param), (2) poll it on a slow 3-minute interval while the panel is alive and prompt once per version with a Reload Window button. Fail-soft throughout: unparseable/failing origin docs degrade to today's unstamped behavior, never an error.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
aarontrowbridge
marked this pull request as ready for review
September 25, 2026 09:12
…ate construction, dispose, polls, prompts (#1556)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1556. Closes #1459 (subsumed — read #1556 first: the evidence, the design rationale, and why the whole lane lands extension-side with zero hub changes).
The ceremony this delivers
The agent ships the dist; the developer gets prompted; reload-the-window lands the new build. No cache surgery, no agent nagging, no stale ghosts.
The three parts
Derive (
dist_build_id.ts, new — vscode-free, every seam injectable): the served dist's build id is theindex-<hash>.jsentry reference in the origin document (verified against the real staged dist: vite base64url charset, fresh-token match somy-index-abc.jsnever matches). The extension HOST's fetches bypass the webview service worker — #1556's whole premise — so the host always sees the true current dist even while the framed app is stuck on the previous ship. Fail-soft throughout: fetch failure / non-200 / unparseable → undefined, never a throw.Stamp (the #1459 fix, both HTML paths): the panel's iframe src carries
amicode_build=<id>alongside the existing param convention (colorScheme,auth_token,amicode_hide_project, …) — a new dist = a new URL = the SW's navigation cache can never serve the old app across ships. The construction fetch is started before the first render; the sync factory signatures pin the first render synchronous, so a cache-miss panel converges via ONE guarded re-render: pre-app-ready only (appReadySeencloses the window — a live session is never re-navigated), only when the id changed, never on a disposed panel. A window-wide per-origin cache means every panel after the first stamps its first render. Re-frames re-derive and re-stamp from the NEW origin.Prompt: a slow poll (3 min) compares served vs stamped; on drift, one information message — "Amicode: a new app build is live (
<id>). Reload Window to pick it up." — with a Reload Window button (workbench.action.reloadWindow). Once-per-version semantics are window-wide (side-by-side tabs prompt exactly once per ship); the prompted set marks before the prompt resolves so overlapping polls never double-fire; a stamped-undefined panel (unknown baseline) prompts on the first served id it sees; undefined served → never prompts.Evidence
~-expansion home-dir, cli_gate staged bins, skill_drift_lint × 2), reproduced identically on clean base via a control run; none touch the lane's files. Director re-verified the two runnable ones on the branch: same failures, unrelated areas.pnpm typecheck(workspace): all 4 packages clean.src/dist_build_id.ts(new),src/chat_panel.ts(+135), the two new test files. No app-bundle/overlay/manifest surface, no service changes, no engine changes.Named follow-ups (deliberately out of this slice)
GET /amicode/app-versionservice route (v1 derives from the origin doc — no hub changes needed, so the lane works against today's deployed hub).