Skip to content

Windows support: build fixes, agent integration, OpenRouter launches, PowerShell default, CI - #8

Open
lgorby wants to merge 2 commits into
per-simmons:mainfrom
lgorby:windows-support
Open

Windows support: build fixes, agent integration, OpenRouter launches, PowerShell default, CI#8
lgorby wants to merge 2 commits into
per-simmons:mainfrom
lgorby:windows-support

Conversation

@lgorby

@lgorby lgorby commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Two commits bringing ADE from macOS-only to working end-to-end on Windows:

  • Fix Windows build and runtime — patches node-pty, replaces the shell postinstall script with a cross-platform TypeScript one, and makes git/terminal-host handling Windows-safe.
  • Windows agent integration, OpenRouter launches, PowerShell default, presets, CI — Windows-aware agent wrappers and notify hooks for Claude Code / Codex / OpenCode, OpenRouter model launches from the model bar (Kimi K2.7, MiniMax M3, GLM 5.2), PowerShell as the default shell on Windows, preset updates, and CI workflow coverage.

Test plan

  • CI passes on this PR (workflow changes included in the second commit)
  • Desktop app builds and launches on Windows (bun run compile:app + bunx electron .)
  • Agent sessions start correctly in PowerShell on Windows
  • OpenRouter model launches work from the model bar

🤖 Generated with Claude Code

lgorby and others added 2 commits July 8, 2026 09:37
- postinstall: rewrite scripts/postinstall.sh as a cross-platform
  scripts/postinstall.ts. On Windows the bare `bash` on PATH resolves to
  the WSL shim rather than Git Bash, so the shebang-based script ran in
  the wrong filesystem context.
- node-pty: patch vendored winpty.gyp to invoke its build batch scripts
  (GetCommitHash.bat, UpdateGenVersion.bat) with an explicit `.\` prefix.
  This machine's NoDefaultCurrentDirectoryInExePath policy disables
  cmd's implicit current-directory search, which the scripts relied on.
- postinstall: re-link node-pty's node-addon-api dependency, which
  `bun patch` drops when converting a patched package from a store
  symlink to a real copy.
- terminal-host: use a Windows named pipe (\.\pipe\...) instead of a
  Unix-domain-socket-style file path for the daemon's IPC socket.
  net.Server.listen() on a plain path throws EACCES on Windows.
- workspaces/git: retry worktree removal's rename() on Windows
  EBUSY/EPERM (a just-killed terminal session's process/ConPTY can hold
  a directory handle open briefly after exit), and replace the
  background cleanup's hardcoded `/bin/rm` with fs.rm on Windows.
…resets, CI

Makes the agent-integration layer (the hooks and shims behind agent status,
notifications, and the memory reflection loop) functional on Windows, plus
four smaller improvements. All macOS/Linux behavior is unchanged.

Agent integration on Windows:
- notify-hook: keep notify.sh canonical everywhere (codex/opencode/mastra
  templates invoke it through bash), and additionally generate notify.mjs — a
  Node port — on Windows for consumers that can't assume bash. Claude Code's
  --settings hooks run it via an absolute node path resolved at setup.
- agent-wrappers: generate .cmd shims for claude/codex/opencode next to the
  bash wrappers. cmd/PowerShell can't execute the extensionless bash scripts,
  so without these the CLIs ran raw and every hook was silently absent. The
  real binary path is resolved at setup (refreshed each app boot) and embedded.
- terminal env: prepend ~/.ade/bin to PATH for Windows sessions in
  buildTerminalEnv — the shell rc wrappers that do this on Unix don't exist
  for cmd/PowerShell.
- findRealBinary: only consider Windows-executable extensions and let PATH
  directory order dominate (where.exe lists npm's extensionless sh shim
  before the .cmd shim); compare case-insensitively on Windows; skip
  agent-wrapper shims by content, matching the bash resolver.
- opencode plugin: escape backslashes when substituting the notify path into
  the JS template (C:\Users... was being consumed as JS escapes).

OpenRouter models (kimi/minimax/glm):
- getAgentPresetCommands({windows}) emits a `cmd /c "set ...&&claude ..."`
  launch command on Windows; the POSIX inline env-var prefix doesn't parse in
  cmd/PowerShell. Settings preset templates use the platform-aware variant.

Shell and teardown:
- getDefaultShell probes pwsh.exe, then powershell.exe, then cmd on Windows
  instead of always using COMSPEC (cmd.exe).
- teardown: run commands through cmd with windowsVerbatimArguments (libuv's
  default quoting mangles embedded double quotes for cmd), kill hung
  teardowns with taskkill /t (negative-PID group kill is POSIX-only), and
  stop hardcoding /bin/bash on non-darwin.

Agent launch presets:
- A terminal preset named "agent:<runtime>" (e.g. agent:claude) overrides the
  default agent launch command, making flags editable in Settings. The
  explicit prefix avoids colliding with the seeded default presets; the
  spawn path awaits the presets cache so a configured override can't be
  missed by a first-mount race.

CI:
- windows-latest job (typecheck + compile, with the Spectre-mitigated MSVC
  libs node-pty needs); fix stale @superset/desktop filter in the build job.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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