Skip to content

Fix FreeOS Windows installer Chinese mojibake and noisy openXYOS provision - #52

Merged
XYAIStudio merged 2 commits into
mainfrom
cursor/fix-freeos-installer-mojibake-1db6
Sep 18, 2026
Merged

XYAIStudio merged 2 commits into
mainfrom
cursor/fix-freeos-installer-mojibake-1db6

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Windows Setup was failing with exit code 12 (livez timeout) after extract left both a healed live root and a leftover nested openxyos\openxyos tree.

Definitive cause (user PC): start-sidecar.ps1 preferred cwd ...\FreeOS\openxyos\openxyos. From that nested directory, node backend-dist/server.js exits immediately with empty stdout/stderr (node exited (fail-fast)). The same binary from the top-level live root starts and livez works. JWT_SECRET was a red herring when Node was launched by hand without the helper.

This PR:

  1. Cwd picker — if $live\backend-dist\server.js and $live\dist\index.html exist, use $live. Only use $live\openxyos when the top-level server is missing. Same rule in start-sidecar.ps1, the provisioner, desktop Go sidecarAppAt, and Python _sidecar_app_dir.
  2. Fail-fast — log chosen cwd / layout; empty nested crash is written to start.log; provision exits 10 on node exited (fail-fast) instead of sitting 90s for exit 12.
  3. Fresh start evidence — after Shell.Application, require a newer start.log, a live start.pid, or livez; otherwise retry explorer / Start-Process. Logs are truncated each start.
  4. Keeps the earlier mojibake fix — nsExec::Exec (not ExecToLog), UTF-8 logs only, OEM-safe host lines, no raw Node console in the NSIS detail list.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (requested for this installer hotfix)

Type of change

  • Bug fix

Test plan

  • uv run pytest tests/unit/desktop/test_openxyos_provisioner.py tests/unit/desktop/test_nsis_uninstall.py tests/unit/desktop/test_nsis_detail_encoding.py tests/unit/test_sidecar_launch.py -q — 61 passed
  • Layout picker regression: top-level wins when both trees exist (Python helper + script contract + Go TestSidecarAppAtPrefersTopLevelWhenBothExist)
  • make all — not run here (cloud image)
  • End-to-end Chinese Windows install still needed on the Lenovo PC

Checklist

  • Updated CHANGELOG.md
  • README / docs updated

Notes

Do not merge (per request). After this lands on a test installer, provision should exit 0 with livez + .install-ready when the zip layout is present; exit 12 only on a real start/health failure with a fresh start.log.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 18, 2026 01:33
Keep UTF-8 Node/PowerShell output in provision.log and start.log. NSIS
detail now shows localized step results only (nsExec::Exec, stdout
discarded) so Chinese is not misread as GBK. Stop and wait for a leftover
FreeOS openXYOS Node before extract; livez success is not blocked by
transient auth/seed console lines.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Nested .../openxyos/openxyos made `node backend-dist/server.js` exit
immediately with an empty console, so provision waited 90s and failed
with exit 12. Choose the live root when backend-dist + dist exist there;
require fresh start.log/pid/livez after Shell.Application; fail-fast on
node crash instead of a livez timeout.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 18, 2026 02:06
@XYAIStudio
XYAIStudio merged commit 3860bfb into main Sep 18, 2026
11 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/fix-freeos-installer-mojibake-1db6 branch September 18, 2026 02:06
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