[Bug]: persistenthost package fails to compile on Windows — host_race_test.go uses syscall.Kill with no build tag

Author: shivansh-sourceCreated Sep 18, 2026Updated Sep 18, 2026
Labelsbug

What went wrong?

Went to run the backend suite on Windows and it dies before any test runs:

# github.com/aoagents/agent-orchestrator/backend/internal/adapters/chatdriver/persistenthost [.test]
internal\adapters\chatdriver\persistenthost\host_race_test.go:86:33: undefined: syscall.Kill
internal\adapters\chatdriver\persistenthost\host_race_test.go:95:34: undefined: syscall.Kill
FAIL	github.com/aoagents/agent-orchestrator/backend/internal/adapters/chatdriver/persistenthost [build failed]

host_race_test.go uses syscall.Kill(-pid, syscall.SIGKILL) in two t.Cleanup calls to tear down the spawned hosts. That's POSIX-only — killing a process group via negative PID doesn't exist on Windows.

The file just has no build constraint on it. Looks like an oversight rather than intent, since everything else platform-specific in that package is already split properly (child_unix.go/child_windows.go, spawn_unix.go/spawn_windows.go). Came in with #4766 by the looks of the history.

Sticking //go:build unix at the top fixes it and keeps the tests running everywhere they currently pass.

Couple of things that make this more annoying than a normal platform-skipped test:

  • It's a build error, not a test failure, so go test ./... and go vet ./... both blow up on Windows regardless of what you touched. Took me a while to convince myself it wasn't my own change.
  • persistenthost is the detached host layer behind Codex and the ACP chat providers, so none of the restart/reconnect behavior has any Windows coverage right now, and a real regression there would be hidden behind this.

Doesn't look like a dupe of #3687 — that one's about tests that run and fail on Windows (path assumptions, TempDir cleanup). This one won't compile at all.

Probably worth flagging on #5416 too, since that turns on Windows Go tests in CI and will hit this straight away.

One thought for later: those two tests cover genuinely cross-platform behaviour (stale descriptor handling, the O_EXCL launch lock), so a Windows equivalent would be better than just excluding them. The build tag is enough to unblock though.

Windows 11, go1.26.5, on main @ 8e486821.

Source: Untrivial-ai/agent-orchestrator