You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feat: Support running Cortex natively on Windows (no WSL) #1520
Some users run coding agents (e.g. opencode) on locked-down Windows VDIs. These don't support virtualization, so WSL isn't an option. Today Cortex only builds and installs on Linux and macOS.
Current state (GOOS=windows GOARCH=amd64 go build on main)
cmd/cortex fails in one place: core/bootstrap/bootstrap.go:67 uses syscall.SIGUSR1 (the log-level toggle). With that guarded, the proxy may build as-is.
cmd/agentop fails on:
cmd_bob_launch.go:220 and setup_unsupervised.go:30: SysProcAttr{Setsid: true}
cmd_service_platform.go:342,421 and setup_probe.go:213: syscall.Kill, including Kill(pid, 0) used as a liveness probe
Work needed
Move the Unix-only signal and process code behind _unix.go/_windows.go files:
Replace the SIGUSR1 toggle on Windows (e.g. a stats/admin endpoint or an agentop command).
Detach processes with CREATE_NEW_PROCESS_GROUP/DETACHED_PROCESS instead of Setsid.
Check liveness with OpenProcess instead of Kill(pid, 0).
Add a service backend: agentop service install only knows launchd and systemd. Windows needs a Task Scheduler logon task or a Windows service, or should fall back to --no-service plus the built-in supervisor (cmd/cortex/supervise.go).
Audit the remaining POSIX assumptions:
cmd_exec.go relays SIGHUP.
Shell-based installer (install.sh) → PowerShell installer or a release zip.
These results come from reading the code and from a GOOS=windows cross-compile. Nothing was run on a real Windows machine.
Build state, compared with the issue body
cmd/cortex now builds for Windows with the full profile. CI's go-ci-windows job builds it and runs the bootstrap, session-archive and cost-ledger tests.
cmd/agentop still fails, with 10 errors in 7 files:
Release binaries:release-binaries.yaml builds only linux and darwin (amd64 and arm64), as .tar.gz.
Real blockers
1. The proxy cannot be stopped cleanly.
cmd/cortex/main.go waits for SIGTERM/SIGINT before it closes ports, stops plugins and flushes its state.
cmd/cortex/supervise.go stops its child with cmd.Process.Signal(syscall.SIGTERM). On Windows, Go's Process.Signal can only kill a process, so this call returns an error.
A background process with no console also gets no Ctrl-C or Ctrl-Break events.
Result: every stop, restart and update kills the proxy at once. Plugin Stop, the ledger flush and the archive flush do not run.
Needed: a new stop path, such as a loopback shutdown endpoint or a named Windows event. cortex, the supervisor and agentop's service commands must all use it. Someone must choose the design first.
2. The TLS bridge cannot build its trust bundle.
core/tlsbridge/bundle.go builds bundle.crt from the bridge CA plus the system roots. It gets the system roots only from Unix PEM files, such as /etc/ssl/cert.pem.
Windows has none of these files, so EnsureTrustBundle returns an error.
Without the bundle, agentop cannot set SSL_CERT_FILE, REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE.
Needed: export the Windows ROOT store through crypt32 (estimate: about 150 lines).
Not tested: I expect a third-party Go tool such as gh to ignore SSL_CERT_FILE on Windows, as it does on macOS.
3. The target environment (not verified).
This issue is for locked-down Windows VDIs. Such machines can have:
AppLocker or WDAC rules that block an unsigned .exe in a user folder
SmartScreen and Defender warnings on downloaded binaries
no administrator rights
group policy that blocks new scheduled tasks
If they have these controls, our binaries cannot run there at all. Authenticode signing is a cost and a process decision, not code.
Question for the requester: on that VDI, can a user run an unsigned .exe from their home folder? Can they create a scheduled task? Do they have administrator rights? Does the VDI already send traffic through a corporate proxy?
Port work (not blockers)
Area
Problem
Estimate (lines)
Compile fixes
Split the 10 call sites into _unix.go and _windows.go files.
150–250
Port and process probes
setup_probe.go uses lsof, ss and /proc. Windows needs netstat or the Win32 TCP table.
200–400
Self-update
Windows does not let a program replace its own running .exe. The auto-update lock needs a Windows lock in place of Flock.
200–400
Shell functions
bob, pi and setup_files.go write to ~/.zshrc or ~/.bashrc. Windows needs the PowerShell $PROFILE.
200–400
Service backend
cmd_service_platform.go (1,106 lines, 63 launchctl/systemctl references) needs a Task Scheduler or Windows-service version, with the auto-update timer and uninstall.
800–1,500
Installer
An install.ps1 and a release .zip.
300–500, plus the workflow
core/peerproc
No Windows code (other.go returns ErrUnsupported). cmd/cortex logs a warning and turns process attribution off, so it still works, but it cannot file requests by process or show cost per project. PID and exe from the TCP table are possible.
300–600
Reading an agent's environment
codex_daemon.go and opencode.go read another process's environment. Windows needs NtQueryInformationProcess and ReadProcessMemory.
small
Tests
42 of 83 cmd/agentop test files use shell scripts or chmod. CI also needs a Windows agentop job.
500–1,000
Total estimate: about 3,000–5,000 lines in 3–5 PRs. These numbers are estimates from file sizes, not measurements.
Suggested order
Get an answer to the VDI question above. It decides whether this work is worth starting.
Compile fixes, probes and self-update, plus the stop-path design. Run the proxy with --no-service and the supervisor. This gives a first usable version.
The service backend.
The trust bundle, shell functions, installer and Windows release .zip.
peerproc for Windows.
Test machine
A Windows 11 ARM VM in UTM on an Apple Silicon Mac works for interactive tests, without a product key (unactivated). For compile fixes and unit tests, the windows-latest CI runner is enough.
Thanks @huang195, happy to own this. As we discussed on our call, I'll come back to it after the recording work (#1920), unless someone needs it sooner. I have a real Windows laptop to test on, so ping me if anything Windows-related comes up meanwhile.
Activity
ci: Check out the Windows job without .claude/, whose colon paths Win…
Fix: Build cmd/cortex and keep the session archive and cost ledger on…
refactor: Split the Windows rename step by build tag, and hold every …
test: Skip TestWriteSession_FailedEraseKeepsNumbering on Windows (#1887)
refactor: Split the Windows rename step by build tag, and hold every …
huang195 commentedon Nov 16, 2026
Findings on
main(2026-11-16)These results come from reading the code and from a
GOOS=windowscross-compile. Nothing was run on a real Windows machine.Build state, compared with the issue body
cmd/cortexnow builds for Windows with thefullprofile. CI'sgo-ci-windowsjob builds it and runs thebootstrap, session-archive and cost-ledger tests.cmd/agentopstill fails, with 10 errors in 7 files:Setsid:cmd_bob_launch.go,setup_unsupervised.gosyscall.Kill:cmd_service_platform.go,codex_daemon.go,setup_probe.gosyscall.Flock:cmd_update_auto.gosyscall.Access:setup_step_binaries.gorelease-binaries.yamlbuilds onlylinuxanddarwin(amd64 and arm64), as.tar.gz.Real blockers
1. The proxy cannot be stopped cleanly.
cmd/cortex/main.gowaits forSIGTERM/SIGINTbefore it closes ports, stops plugins and flushes its state.cmd/cortex/supervise.gostops its child withcmd.Process.Signal(syscall.SIGTERM). On Windows, Go'sProcess.Signalcan only kill a process, so this call returns an error.Stop, the ledger flush and the archive flush do not run.cortex, the supervisor andagentop's service commands must all use it. Someone must choose the design first.2. The TLS bridge cannot build its trust bundle.
core/tlsbridge/bundle.gobuildsbundle.crtfrom the bridge CA plus the system roots. It gets the system roots only from Unix PEM files, such as/etc/ssl/cert.pem.EnsureTrustBundlereturns an error.agentopcannot setSSL_CERT_FILE,REQUESTS_CA_BUNDLEorCURL_CA_BUNDLE.ROOTstore through crypt32 (estimate: about 150 lines).ghto ignoreSSL_CERT_FILEon Windows, as it does on macOS.3. The target environment (not verified).
.exein a user folder.exefrom their home folder? Can they create a scheduled task? Do they have administrator rights? Does the VDI already send traffic through a corporate proxy?Port work (not blockers)
_unix.goand_windows.gofiles.setup_probe.gouseslsof,ssand/proc. Windows needsnetstator the Win32 TCP table..exe. The auto-update lock needs a Windows lock in place ofFlock.bob,piandsetup_files.gowrite to~/.zshrcor~/.bashrc. Windows needs the PowerShell$PROFILE.cmd_service_platform.go(1,106 lines, 63launchctl/systemctlreferences) needs a Task Scheduler or Windows-service version, with the auto-update timer and uninstall.install.ps1and a release.zip.core/peerprocother.goreturnsErrUnsupported).cmd/cortexlogs a warning and turns process attribution off, so it still works, but it cannot file requests by process or show cost per project. PID and exe from the TCP table are possible.codex_daemon.goandopencode.goread another process's environment. Windows needsNtQueryInformationProcessandReadProcessMemory.cmd/agentoptest files use shell scripts orchmod. CI also needs a Windowsagentopjob.Total estimate: about 3,000–5,000 lines in 3–5 PRs. These numbers are estimates from file sizes, not measurements.
Suggested order
--no-serviceand the supervisor. This gives a first usable version..zip.peerprocfor Windows.Test machine
A Windows 11 ARM VM in UTM on an Apple Silicon Mac works for interactive tests, without a product key (unactivated). For compile fixes and unit tests, the
windows-latestCI runner is enough.Assisted-By: Claude (Anthropic AI) [email protected]
huang195 commentedon Nov 17, 2026
@michaljacovi assigning this to you since you started this work. If things change later, we can always make adjustments
michaljacovi commentedon Nov 18, 2026
Thanks @huang195, happy to own this. As we discussed on our call, I'll come back to it after the recording work (#1920), unless someone needs it sooner. I have a real Windows laptop to test on, so ping me if anything Windows-related comes up meanwhile.
fix: Build agentop on Windows, and refuse what needs a Unix service
fix: Check a file's writability without a temp file on Windows
docs: Keep the Windows notes on main-latest, and add Unblock-File and…
fix: Match each listed agentop test by its exact name
fix: Write the CA dir as a single-quoted YAML string in the --local c…
docs: Say to open a new terminal after the PATH step on Windows
feat: Release Windows builds of agentop and cortex as .zip
ci: Cross-build the release's Windows targets, and fix the Windows notes
fix: Fail Windows CI when a listed agentop test does not run, and dro…
fix: Keep the runtime and Go dirs, and let real-account tests opt out
fix: Address review of install.ps1
fix: Drop the parameter cleanup, and make the install.ps1 tests able …
test: Keep agentop's tests out of the real user profile on Windows
fix: Keep fixtures, goldens and test-read docs LF on Windows checkouts
feat: Add a PowerShell installer and a Windows guide
Merge main into macos-stop-status