Skip to content

windows: native (non-WSL) support — tracking map and go/no-go; WSL2 is the supported path today #1658

Closed

Description

@amrmelsayed

Status quo

Native Windows does not work today: afx tower start hangs in its readiness wait because the daemon fails during startup (field-tested 2026-09-09). CI covers Ubuntu and macOS only. WSL2 is the supported path and works end to end (verified same day: build-essential + python3, Node 22 via nvm, npm install -g @cluesmith/codev); the practical setup is ~three commands.

This issue is a tracking/research map for what NATIVE Windows support would take — filed to capture the analysis, not as a commitment to build it.

The map, by depth of surgery

  1. Shellper transport (hard core). Persistent sessions ride Unix domain sockets (ShellperClient → *.sock paths). Windows equivalent is named pipes, which Node's net supports — a transport abstraction (platform-specific endpoint resolution; HELLO/WELCOME framing unchanged). Owner-only socket permissions become pipe ACLs. Everything downstream depends on this: no shellper, no persistent builders, no detached-survival semantics.
  2. Process lifecycle. POSIX process groups + SIGTERM→SIGKILL escalation (PtySession.kill, dev-PTY tree teardown) need Job Objects or taskkill /T branches. The load-bearing "detached shellpers survive a Tower restart" guarantee must be re-proven under Windows process semantics.
  3. The forge layer — the architectural fork. Every forge concept is a shell script (18+ concepts × providers), builders launch via generated bash .builder-start.sh, postSpawn assumes sh. Options: (a) PowerShell twins (doubles maintenance forever), (b) require Git-Bash and route script execution through it (pragmatic; adds a dependency + path-translation quirks), (c) rewrite concepts as Node code (best long-term, biggest one-time cost, framework change hitting codev-skeleton). This decision shapes everything downstream and deserves its own spec if the project proceeds.
  4. node-pty / ConPTY. Ships Windows support; render gate consumes byte streams so the mirror/classifier should carry over — but echo/resize/exit timing differences are exactly the assume-nothing class (afx send: delivery-side silent truncation of long bodies (head-loss can invert meaning) — needs integrity check before Enter #1567's lesson). Gate profiles need Windows-terminal validation captures.
  5. POSIX residue (wide, shallow). Hardcoded /tmp (test utils at minimum), ~ expansion, local-key file modes, symlink-based runnable-worktrees (needs Windows Developer Mode), CLI-side opener branches (the VS Code extension already branches for Explorer).
  6. Windows CI leg — the ongoing tax. windows-latest for unit/integration/e2e plus a stabilization period; without it support rots in weeks. This recurring cost outlives the build-out.

Shape and go/no-go

SPIR-scale, multi-phase: audit → transport + lifecycle → forge-layer decision → script generation → CI leg.

Go/no-go criterion: demand from environments where WSL2 is administratively blocked (locked-down corporate IT) — the only user segment native support unlocks that WSL2 doesn't already serve. Absent that demand, the recommendation is to keep WSL2 as the documented Windows path.

Near-term docs follow-up (independent of this project)

Install docs should state: Linux/WSL needs build-essential + python3 (node-pty compiles from source on Linux), Node ≥ 20 (22 recommended), and Windows users should use WSL2.

Activity

  1. added
    area/cross-cutting
    on Sep 9, 2026
  2. amrmelsayed commented on Oct 11, 2026

    @amrmelsayed
    CollaboratorAuthor

    Architect ruling (2026-10-12): protocol + forge-layer decision

    Protocol: SPIR. Owner-confirmed.

    Forge layer: Git Bash is a hard requirement on native Windows. No script rewrite. Owner ruling.

    Verified in source before ruling:

    • All 56 forge concept scripts (packages/codev/scripts/forge/{github,gitlab,...}) are #!/bin/sh, POSIX-clean (the tower: overview cache burns the user's entire GitHub GraphQL quota (3 gh calls × N workspaces every 30s, failures uncached) — every gh command on the machine then fails #1645 pipefail note shows they already avoid bashisms). Their external tools are gh / glab / jq / curl / git / printf / sed / head / grep / tail / sort / date. Git for Windows ships bash, sed, grep, head, tail, sort, date, curl and git. gh / glab are separate installs on every platform already. jq is the one tool Git Bash does not ship (78 call sites): it becomes a documented Windows prerequisite and a codev doctor check.
    • The scripts are not the problem; the launchers are. Three sites assume a POSIX shell is the system shell:
      1. packages/codev/src/lib/forge.ts:442 runs concepts via execSync(command), which on Windows defaults to cmd.exe and cannot execute a shebang script.
      2. packages/codev/src/agent-farm/commands/spawn.ts:703 starts every builder as /bin/bash .builder-start.sh (hardcoded absolute path).
      3. worktree.postSpawn hooks run through the system shell.

    So items 3(a) PowerShell twins and 3(c) Node port in the map above are off the table. The forge-layer phase collapses to: resolve the Git Bash binary (standard install path, then PATH), route the three launch sites through it, handle Windows-path to bash-path translation for cwd and script arguments, add jq + Git Bash to doctor, and document both as prerequisites.

    Decisions still open for the owner (spec-gate points): scope = full parity vs first cut; Windows CI leg commitment; default spawned shell for architect/builder terminals (Git Bash is the natural answer given this ruling, but it is the terminal the user lives in, so it is the owner's call); one SPIR with phases vs parent spec + child lanes.

  3. amrmelsayed commented on Oct 11, 2026

    @amrmelsayed
    CollaboratorAuthor

    Architect ruling (2026-10-12, part 2): remaining spec-gate points settled

    Owner decisions, in addition to SPIR + Git Bash hard requirement above:

    1. Scope: full parity. Native Windows must deliver the same guarantees as macOS/Linux: persistent builders, detached shellpers surviving a Tower restart, runnable worktrees, forge, consult, porch. A first cut with best-effort builders is NOT acceptable as the end state.
    2. Shape: one SPIR, phased. Not a parent spec with child lanes. The plan should carry the phases from the map (audit → transport + lifecycle → forge/launcher routing → POSIX residue sweep → CI leg), each with its own verification.
    3. Shell roles on Windows. PowerShell is the default interactive shell for architect and shell terminals (.codev/config.json). Git Bash is the only plumbing shell: forge concepts, the builder launch script, postSpawn. No PowerShell twins of any script. Rationale: mirrors Claude Code's own ordering (Git Bash for its Bash tool, PowerShell for the human), avoids doubling the 56-script surface, and sidesteps PowerShell execution-policy restrictions on locked-down machines (the segment this work targets).
    4. Git Bash resolution. Resolve the Git for Windows bash explicitly (standard install paths, then PATH, then an override setting) and NEVER invoke bare bash: the System32 bash.exe launches WSL. Spawn should set or honor Claude Code's CLAUDE_CODE_GIT_BASH_PATH so builders and codev agree on one binary.
    5. Prerequisites and docs. Git for Windows + jq are hard Windows prerequisites, checked by codev doctor (including a CRLF warning for user-authored postSpawn scripts). WSL 2 stays a documented, supported alternative; docs present native + Git Bash and WSL 2 as two paths.
    6. Windows CI leg (recommended, owner confirms at the spec gate). Add windows-latest to the unit, CLI e2e, and post-release e2e workflows. Introduce as non-required during stabilization, then promote to a required check. Windows runner minutes bill at 2x Linux (cheaper than the existing macOS leg); wall time is the larger cost.

    Known Windows-specific items the spec must address (from the Git Bash analysis): MSYS path translation on arguments (per-call opt-out), signals not crossing the bash/native boundary (Job Objects or taskkill at the four process-group kill sites), symlink fallback for runnable worktrees when Developer Mode is off, ConPTY render-gate validation captures.

    Spawn: afx spawn --protocol spir 1658, pending the owner's word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cross-cutting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions