nikivdev/code · error · anyhow::Error

Supervisor IPC is only supported on unix platforms right now

Error message

Supervisor IPC is only supported on unix platforms right now.

What it means

run_server implements the supervisor's IPC server using UnixListener, which is only compiled on unix targets (#[cfg(unix)]). On non-unix platforms (e.g. Windows) the cfg(not(unix)) branch unconditionally bails with this message, since no alternative IPC transport is implemented.

Source

Thrown at src/supervisor.rs:381

    if let Some(parent) = socket_path.parent() {
        fs::create_dir_all(parent)?;
    }

    if socket_path.exists() {
        if supervisor_running(socket_path) {
            println!("Supervisor already running; exiting.");
            return Ok(());
        }
        fs::remove_file(socket_path).ok();
    }

    #[cfg(unix)]
    let listener = std::os::unix::net::UnixListener::bind(socket_path)
        .with_context(|| format!("failed to bind {}", socket_path.display()))?;

    #[cfg(not(unix))]
    {
        bail!("Supervisor IPC is only supported on unix platforms right now.");
    }

    let state = Arc::new(Mutex::new(SupervisorState::default()));
    let bootstrap_state = Arc::clone(&state);
    let initial_active_path = resolve_active_project_config_path();
    std::thread::spawn(move || {
        if let Err(err) = bootstrap_daemons(&bootstrap_state, initial_active_path.as_deref(), boot)
        {
            eprintln!("WARN supervisor bootstrap failed: {err}");
        }
        if let Err(err) = monitor_daemons(bootstrap_state) {
            eprintln!("WARN supervisor monitor failed: {err}");
        }
    });

    #[cfg(unix)]
    {
        for stream in listener.incoming() {

View on GitHub (pinned to a747e741ae)

Solutions

  1. Run the supervisor on macOS or Linux (WSL2 works for Windows users).
  2. Use a Windows CI runner with a Linux container/WSL step for supervisor-dependent commands.
  3. Wait for/raise an issue requesting a Windows named-pipe IPC transport.

Example fix

// before (Windows PowerShell)
myapp supervisor serve
// error: only supported on unix
// after
wsl myapp supervisor serve
Defensive patterns

Strategy: validation

Validate before calling

import * as os from 'node:os';
if (os.platform() === 'win32') {
  console.error('Supervisor IPC requires unix; use WSL2 or a Linux/macOS host.');
  process.exit(1);
}

Type guard

function isUnixPlatform(): boolean {
  return process.platform !== 'win32';
}

Try / catch

try {
  await supervisorServe();
} catch (e) {
  if (String(e).includes('only supported on unix platforms')) {
    console.error('This command is unix-only. Re-run inside WSL2/Linux/macOS.');
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Running the supervisor server command (run_server, via run) on a non-unix platform — Windows builds always hit this; there is no input that avoids it.

Common situations: Developer runs the supervisor on Windows; CI job on a Windows runner; cross-platform team where docs assume macOS/Linux only.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/0b575640e9912a22. Report an issue: GitHub.