Skip to content

Fix blank Organization embed of local openXYOS - #44

Merged
XYAIStudio merged 2 commits into
mainfrom
cursor/fix-openxyos-blank-embed-a5ee
Sep 17, 2026
Merged

XYAIStudio merged 2 commits into
mainfrom
cursor/fix-openxyos-blank-embed-a5ee

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Organization can show 本机 openXYOS 已连接 while the iframe stays white. On the user’s Windows machine, livez was fine and http://127.0.0.1:3780/ returned HTML, but a day-old sidecar Node still used a stale CORS_ORIGIN that rejected its own origin (Origin: http://127.0.0.1:3780). Module/CSS/font/login requests then 500’d and the preview stayed blank.

This PR makes that failure mode durable to fix:

  1. CORS self-host allow — mergeCorsOrigins / corsAllowsSelf always add http://127.0.0.1:<PORT>, http://localhost:<PORT>, and http://[::1]:<PORT> even when CORS_ORIGIN only lists dashboard ports (8088 / 18900 / …). livez now reports self_origin_allowed.
  2. Restart on FreeOS launch — start-sidecar.ps1 no longer exits early just because livez is up. It stops the previous FreeOS-openxyos Node under the live dir (start.pid + bundled node.exe), then starts with the shipped env/CORS list. Desktop Go and the Python helper do the same; Windows prefers the current start-sidecar.ps1.
  3. Layout heal before start — if the live tree has nested openxyos\dist\index.html (or a deeper nest) but is missing top-level dist\index.html / backend-dist\server.js, promote/copy the same way as Repair-OpenXYOSLayout.
  4. Org UI — if livez is up but a document request with the sidecar’s own Origin is 5xx, show a clear overlay and status chip instead of a silent white iframe. No “启动边车 / 重试启动” CTA.

Does not change the install-tar / stop-before-extract path (that work is in another agent).

Test plan

Verified on this revision:

  • npx tsx scripts/test-cors-origins.ts (openXYOS) — passed
  • python -m pytest tests/unit/test_sidecar_launch.py tests/unit/test_org_module.py tests/unit/desktop/test_openxyos_provisioner.py tests/unit/desktop/test_nsis_uninstall.py -q — 65 passed
  • cd dashboard && npx vitest run src/pages/Organization src/layouts/sidebarNav.test.ts — 15 passed
  • cd dashboard && npx tsc --noEmit — passed
  • mypy --strict on sidecar_launch.py / service.py / overview.py — passed
  • Desktop go test cannot run in this image (missing GTK4 / WebKitGTK). New cases are in process_sidecar_test.go.

Target branch

  • Base is main (requested)

Type of change

  • Bug fix
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 17, 2026 09:28
Always allow the sidecar listen origin even when CORS_ORIGIN is stale,
replace a day-old FreeOS-openxyos Node on start, heal nested live
layouts, and surface a preview error when livez is up but self-origin
asset requests fail.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Tighten the stale-whitelist assertion so reqHost matching one listen
host does not imply every self-origin is allowed, and apply ruff/prettier
on the start/heal helpers.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 17, 2026 09:57
@XYAIStudio
XYAIStudio merged commit 8d8c19a into main Sep 17, 2026
12 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/fix-openxyos-blank-embed-a5ee branch September 17, 2026 09:57
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.

2 participants