feat: add support for agentsock on Windows by spikecurtis · Pull Request #22171 · coder/coder

Conversation

@spikecurtis

relates to #21335

Adds support for the agentsock and thus coder exp sync commands on Windows. This support was initially missing.

spikecurtis

logger := slog.Make().Leveled(slog.LevelDebug)
server, err := agentsocket.NewServer(logger, agentsocket.WithPath(socketPath))
require.NoError(t, err)
require.NoError(t, server.Close())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just dupes StartStop so I removed.

@coder-tasks

Documentation Check

Updates Needed

  • docs/admin/templates/startup-coordination/troubleshooting.md - The troubleshooting steps use Linux-specific commands (/proc/$(pidof -s coder)/environ, Unix socket paths like dial unix /tmp/coder-agent.sock) that won't work on Windows. Now that Windows is supported via named pipes, the doc should note Windows-equivalent steps or add platform-specific callouts for the verification command.

Automated review via Coder Tasks

SasSwart

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've spent an hour or so looking into go-winio and named pipes to gather context for this Code review. Given what I've been able to read, this looks good!

2 participants

@spikecurtis @SasSwart