Skip to content

Fix openXYOS $home clash and missing backend-dist migrations - #37

Merged
XYAIStudio merged 1 commit into
mainfrom
cursor/fix-openxyos-home-and-migrations-eda9
Sep 17, 2026
Merged

XYAIStudio merged 1 commit into
mainfrom
cursor/fix-openxyos-home-and-migrations-eda9

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Windows install-time openXYOS start still failed after #36 on a real machine: data landed under %USERPROFILE%\org-os, then Node died on missing SQL and livez never came up.

What changed

  1. $home → $freeosHome in start-sidecar.ps1. Windows PowerShell treats $HOME / $home as a read-only automatic variable. Assignment throws SessionStateUnauthorizedAccessException; with $ErrorActionPreference = Continue the script keeps going and $home stays the profile root (C:\Users\Lenovo), so SQLite is created at C:\Users\Lenovo\org-os\xiongyuan.db instead of %USERPROFILE%\.freeos\org-os\.

  2. Ship backend-dist/migrations/*.sql in openxyos-runtime.zip. Compiled server.js reads SQL via path.join(__dirname, "migrations/…"). After esbuild, that is backend-dist/migrations, not backend/migrations. Missing 013_audit_bundle.sql makes initDatabase() ENOENT and livez never becomes ready. Bundle + stage now copy all backend/migrations files next to server.js and refuse a compiled zip that lacks the four runtime SQL files (013–016).

  3. Provisioner heal for an already-extracted live tree that looks complete (node + dist) but is missing backend-dist/migrations. Reinstall copies SQL from backend/migrations (or the install-dir backup) without waiting for a 90s livez timeout.

#36 fail-fast start.log / UseShellExecute=false / CORS env handoff is unchanged. start.log now also records DATABASE_PATH and FREEOS_HOME so a wrong data root is obvious.

Target branch

Type of change

  • Bug fix

Test plan

  • Added/updated tests (tests/unit/desktop/test_openxyos_provisioner.py, test_stage_openxyos_runtime.py)
  • Local: python3 -m pytest --noconftest tests/unit/desktop/test_openxyos_provisioner.py tests/unit/desktop/test_stage_openxyos_runtime.py -q → 17 passed
  • Local: ruff check + ruff format --check on changed Python files
  • CI make all on this PR (this cloud image has no uv / full Octop env)

Checklist

  • Updated CHANGELOG.md
Open in Web Open in Cursor 

Windows PowerShell treats $home/$HOME as read-only, so start-sidecar.ps1
was leaving SQLite under %USERPROFILE%\org-os. Use $freeosHome instead.

Compiled server.js reads SQL from __dirname/migrations; include those
files in openxyos-runtime.zip and heal existing live trees on provision.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 17, 2026 02:08
@XYAIStudio
XYAIStudio merged commit a445f2c into main Sep 17, 2026
12 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/fix-openxyos-home-and-migrations-eda9 branch September 17, 2026 02:33
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