Skip to content

fix(site-editor): pick the content backend from the v8 marker; v7 never waits - #7873

Closed
tlgimenes wants to merge 11 commits into
split/46-v8-always-fast-previewfrom
split/47-content-backend-by-marker
Closed

tlgimenes wants to merge 11 commits into
split/46-v8-always-fast-previewfrom
split/47-content-backend-by-marker

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Part of the v8 Studio stack (base: #7796). v8 Fast Preview + Localhost track, on top of #7872. PO decisions of 2026-10-11.

R1: v7 sites behave as on main. R4: a v8 sandbox session uses the daemon's content protocol. The site editor now picks its content backend from the project's Blocks v8 marker (#7871) instead of waiting on probes for every site.

What

selectContentBackend (components/sections-editor/content-backend.ts) gets isV8Project:

v8 project (marker) v7 project (no marker)
Waits (pending)? Yes, until its backend answers. It never shows the v7 editor first Never: legacy right away, as on main
Stored deco serve connection Used (Localhost) and wins Ignored: useDecoServeConnection reads as none
cms session GitHub backend, i.e. the hosted draft (R3) Legacy. In flagged orgs one background probe still runs, and only a v8 answer (an upgrade branch) switches it
Sandbox session Waits for the working tree and the daemon's /_sandbox/rpc, then uses the protocol (R4). An older daemon (404), a v7 tree or an error falls back to legacy Legacy. The same background probe rule applies
Probe retries 2, plus a 5 s re-poll on error 1, with no re-poll, so there is no repeated 503/404 loop
  • /site-editor (account-less) counts as v8: only a v8 deco serve answers it.
  • This closes the OPEN note in selectContentBackend (a v8 sandbox showed the v7 editor until the probe answered).
  • Versions and Site tokens are shown only for v8 sites (hostedCmsAvailable(flag, isV8)). A v7 site never shows them and never waits on the flag for them.

R1 notes

On a v7 project, backend.kind is never pending, so the v7 editor shows right away with no wait on org settings or the GitHub probe. The probe runs only in flagged orgs, tries once in the background, and never re-polls.

Tests

  • content-backend.test.ts: a decision table.
    • v7 is never pending across every flag × runtime × probe combination, ignores a stored connection, and switches only on a v8 answer behind the flag.
    • v8: Localhost wins; a cms session waits and then uses the protocol; a sandbox session waits for the daemon and then uses its protocol, falling back on 404, v7 or error.
    • hostedCmsAvailable gates Versions and Site tokens.
  • use-content-backend.test.ts: GitHub and daemon detection decide the same marked or not once settled. backgroundProbeRetry shows v7 has no refetch loop after a 503 and v8 re-polls.
  • tsc --noEmit for apps/web, oxlint, and biome format are clean. 152 test files under sections-editor, thread, main-panel-tabs, hooks, views/virtual-mcp and routes, each run in its own process, all pass.

Stack

v8 Fast Preview track: previous: #7872 · next: #7874

Review fixes (86bdfbe)

  • v7 (no marker) is always legacy, as on main. It runs no GitHub or daemon probe (contentProbesEnabled) and never switches backend mid-session. backgroundProbeRetry is removed. A v7 site that upgrades to v8 gets the marker once the upgrade reaches main.
  • v8: a failed probe (a GitHub 5xx, or the daemon restarting) is now unavailable and keeps retrying instead of showing the v7 editor. Only a confirmed v7 answer, or the flag being off, falls back to legacy.
  • v8 ignores a tunnel saved from the v7 Advanced → Local.
  • Tests: v7 stays legacy for every combination, including a probe that would answer v8, and v7 runs no probe. A v8 probe error is unavailable.

The table above still describes v7 "switching on a v8 answer". That no longer happens.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

…er waits

`selectContentBackend` takes the project's Blocks v8 marker:

- v8: the editor waits for its backend and never shows the v7 editor first.
  Localhost (a connected deco serve) wins; a cms session uses the GitHub
  backend (the hosted draft); a sandbox session waits for the daemon's
  content protocol once the working tree is there (R4).
- v7 (no marker): legacy right away, as on main. Never pending, a stored
  deco serve connection is ignored (useDecoServeConnection reads as none),
  and the background probe tries once with no 5 s re-poll on errors. Only
  a v8 answer (an upgrade branch) switches it.

Versions and Site tokens show only for v8 sites (`hostedCmsAvailable`).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes and others added 10 commits October 11, 2026 14:24
…re is unavailable

- v7 (no marker): legacy with no exceptions, as on main. The GitHub and
  daemon probes run only for v8 projects, so a v7 site sends no probe and
  never switches backends mid-session (backgroundProbeRetry is gone).
- v8: a failed probe (GitHub 5xx, the daemon restarting) is `unavailable`
  and keeps retrying, instead of falling back to the v7 editor. Only a
  confirmed v7 answer or the flag off is legacy.
- v8 ignores a tunnel saved by the v7 Advanced -> Local.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The field component tests stub `@/sdk/hooks/use-virtual-mcp`; the `@/sdk`
barrel import bypassed the stub, so every image/file field crashed with
"useProjectContext must be used within a ProjectContextProvider" (39 CT
failures on the stack top).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The editor picks a project's backend from its Blocks v8 marker, which the
first read of main's schema writes. Both project specs now make that read
before the page opens, and the deco serve one uses a v8 project (a v7
project keeps main's Local tunnel).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
@tlgimenes

Copy link
Copy Markdown
Contributor Author

Folded into #7887 (API) / #7888 (web, stacked on #7887). The tree of #7888 equals this stack's top (split/51-v8-per-site). The branch is kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

@tlgimenes tlgimenes closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant