Skip to content

fix: clean windows onboarding (reviewed + fixed)#798

Merged
web3dev1337 merged 15 commits intomainfrom
fix/windows-onboarding-clean
Mar 9, 2026
Merged

fix: clean windows onboarding (reviewed + fixed)#798
web3dev1337 merged 15 commits intomainfrom
fix/windows-onboarding-clean

Conversation

@web3dev1337
Copy link
Owner

@web3dev1337 web3dev1337 commented Mar 8, 2026

Summary

Cherry-picked the good parts from AnrokX PRs #796 and #791, fixed all review issues, and added Windows-specific fixes discovered during testing.

From AnrokX PRs (cherry-picked)

  • Onboarding wizard with setup action service
  • Diagnostics-gated workspace creation
  • Welcome modal deduplication
  • Startup workspace restore with deferred session init
  • Updater plugin panic prevention

Fixes applied on top

  • Removed 60 lines of dead code (guidance variable computed but never rendered)
  • Fixed memory leak in setupActionRuns Map (added 50-run retention limit)
  • Updater pubkey kept as empty string (Tauri requires the field even when inactive)
  • stderr on non-Windows now uses inherit instead of null for debugging
  • Node.exe bundling — added `resources/backend/node/*` to Tauri resource config (was missing, caused silent crash)
  • Eliminated PowerShell window flashing — replaced all `execFile` calls with `spawn` + `CREATE_NO_WINDOW` (0x08000000) flag across 4 files:
    • `sessionManager.js`: checkProcessLimit() was spawning powershell.exe every 5s per session (main culprit)
    • `index.js`: getChildPids() and getRssKb()
    • `diagnosticsService.js`: all diagnostic checks
    • `setupActionService.js`: all setup action spawns
  • Updated tests to mock `spawn` instead of `execFile`

Verified on Windows

  • Built Tauri installer from this branch
  • Installed and launched on Windows 11
  • No more constant PowerShell window flashing (only 3-4 brief flashes at startup from node-pty conpty initialization — unavoidable)
  • App launches, shows bootstrap screen, starts backend, loads UI

Test plan

  • All 438 unit tests pass (81 suites)
  • `node --check server/index.js` passes
  • Tauri build produces working installer
  • Fresh install on Windows works end-to-end
  • No PowerShell window flashing during normal operation

Supersedes #796 and #791. Close those after merging this.

🤖 Generated with Claude Code

web3dev1337 and others added 15 commits March 9, 2026 10:57
Cherry-pick the windows onboarding flow from AnrokX PRs #796 and #791
with all review issues fixed:

Features ported:
- First-run dependency wizard (Git, Node, npm, gh, Claude, Codex)
- Setup action service with PowerShell command runner
- GitHub CLI device-flow login with code detection
- Git identity configuration (name/email)
- Diagnostics panel enhancements
- Toast notification CSS rewrite
- Workspace startup race condition fix (workspaceSystemReady gate)
- Desktop launch trace support in bootstrap page

Issues fixed from review:
- Remove dead `guidance` variable (~60 lines never rendered in template)
- Add retention limit (50 runs) to setupActionService Maps (memory leak)
- Disable updater plugin instead of empty pubkey (prevents silent update failures)
- Keep stderr on non-Windows platforms for debugging (was nulled everywhere)
- Document autoCreate behavioral change in workspaceManager
- Exclude binary artifacts (zip files) and patch script from cherry-pick

Based on work by AnrokX in PRs #796 and #791.

Co-Authored-By: AnrokX <anrokx@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The resources glob missed resources/backend/node/* so node.exe
was prepared by the build script but never included in the installer.
App would silently exit on launch because it couldn't find Node.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tauri's updater plugin panics with "missing field pubkey" even when
active: false. The empty string is the correct workaround — it
satisfies the deserializer while the runtime updater builder
(build_runtime_updater) already gates on ORCHESTRATOR_UPDATER_ENABLED
env var before attempting any update checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace execFile with spawn + CREATE_NO_WINDOW flag for all
diagnostic and setup action commands. On Windows, .cmd/.bat
files are routed through cmd.exe directly (avoiding retry path
that flashed windows). The creationFlags: 0x08000000 flag
prevents any console window from appearing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: sessionManager.checkProcessLimit() spawns powershell.exe
every 5 seconds per terminal session using execFile without
CREATE_NO_WINDOW flag. With 4 sessions = 4 visible PowerShell windows
every 5 seconds.

Fixed all spawn points across 4 files:
- sessionManager.js: checkProcessLimit() and taskkill
- index.js: getChildPids() and getRssKb() in /api/process/performance
- diagnosticsService.js: all diagnostic checks (already fixed)
- setupActionService.js: all setup action spawns (already fixed)

All now use spawn() with creationFlags: 0x08000000 (CREATE_NO_WINDOW)
instead of execFile().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The shouldAutoShow logic included `|| !coreReady` which forced the
wizard to re-open if Claude/Codex CLI wasn't in PATH, even after the
user had already completed onboarding. Now once completed, it stays
completed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isOnboardingLocked() was requiring coreReady (git + agent CLI) to
unlock. If Claude/Codex CLI wasn't in PATH, the modal was permanently
locked open and couldn't be dismissed. Now once readCompleted() is
true, the lock is released regardless of coreReady state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dependency-onboarding-booting CSS class (which hides all page
content) was applied unconditionally on Windows hosts before any
async check. Now it reads the completion flag from localStorage
first and skips the boot overlay if onboarding was already completed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: persist onboarding state across tauri restarts
@web3dev1337 web3dev1337 merged commit dbdb7d0 into main Mar 9, 2026
5 checks passed
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