Skip to content

Route internal visual comparisons through the direct WordPress origin #2109

Description

@chubes4

Problem

After #2102 separated the direct WordPress Playground origin from the serialized exposed-preview proxy, authenticated editor commands correctly use server.wordpressUrl, but wordpress.visual-compare still resolves local URLs from server.serverUrl.

A real eight-route SSI university run proves the proxy is not a valid internal browser origin for canonical WordPress front-end routes:

  • proxy origin: http://127.0.0.1:60757
  • direct WordPress origin: http://127.0.0.1:53158
  • staged source capture on the proxy succeeds
  • candidate /, /contact/, /courses/, /events/, /faculty/, /news/, and /programs/ fail with ERR_TOO_MANY_REDIRECTS
  • /research/ times out during the same canonical redirect loop
  • editor commands using the direct origin validate 269/269 blocks

Root cause

browser-visual-compare.ts calls browserPreviewRouting(args, runtimeSpec, server.serverUrl) while editor commands use server.wordpressUrl ?? server.serverUrl. Internal source/candidate capture should remain same-origin with WordPress and avoid the serialized exposed-preview proxy. Public/exposed preview behavior remains a separate explicit mode.

Acceptance criteria

  • Local wordpress.visual-compare uses the direct WordPress origin when available.
  • Explicit public/routed preview modes retain their existing behavior.
  • Add a real or contract-level regression proving local source and candidate routes do not traverse the preview proxy.
  • Rerun all eight 27-university-department visual comparisons.

Related: #2095 and #2102.

AI assistance

  • Model: OpenAI GPT-5.6 Sol
  • Tool: OpenCode
  • Used for: cross-stack reproduction and origin-routing diagnosis with Chris Huber.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions