Skip to content

fix(portable): make the Windows x64 portable bundle start on Windows - #108

Merged
spelech merged 2 commits into
mainfrom
fix/windows-portable-bundle-startup
Nov 11, 2026
Merged

spelech merged 2 commits into
mainfrom
fix/windows-portable-bundle-startup

Conversation

@spelech

@spelech spelech commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes 7 issues discovered during Windows x64 portable bundle field testing:

  1. Server Startup Hang (portable_postgres.py): pg_ctl start was executed with capture_output=True, which on Windows caused the inherited postgres child process pipe to block subprocess.run() indefinitely. Output is now redirected to data/pg_ctl.out with stdin=subprocess.DEVNULL and a 120s timeout.
  2. PowerShell 5.1 Compatibility (scripts/portable/): start-contextcortex.bat invokes Windows PowerShell 5.1, which failed on the PowerShell 7 ?? null-coalescing operator. Extracted the launcher and .env.example into scripts/portable/ with PS 5.1 compatibility and CRLF line endings via .gitattributes.
  3. CA Bundle Public Root Retention (start-contextcortex.ps1): Preserves _internal/certifi/cacert.pem public root CAs when appending corporate .crt/.pem certificates from .\certs\.
  4. Frozen Exe Path Resolution (main.py): Sets DATA_DIR, VAULT_PATH, CACHE_DB_PATH, VECTOR_STORE_STORAGE_PATH, and TMP_REPOS_DIR next to contextcortex.exe before app.* imports when running frozen.
  5. Default API Embedding Provider (main.py, .env.example): Defaults EMBEDDING_PROVIDER=api and EMBEDDING_MODEL=text-embedding-3-small in frozen mode so the first startup does not create a 384-dim local FastEmbed table.
  6. Cold-Start Model Discovery Timeout (litellm_service.py): Increased /v1/models discovery timeout from 6.0s to 15.0s.
  7. CI Runtime Smoke Test (build-portable-windows.yml): Starts contextcortex.exe in CI, bootstraps portable PostgreSQL + pgvector, and verifies /ready reports status == 'ready' and database.type == 'postgresql' before packaging the zip.

@spelech
spelech merged commit 38d2abe into main Nov 11, 2026
16 checks passed
@spelech
spelech deleted the fix/windows-portable-bundle-startup branch November 11, 2026 17:34
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.

1 participant