Skip to content
Prev Previous commit
Next Next commit
Add yamux to the agentsocket client and add an error stub for it in w…
…indows
  • Loading branch information
SasSwart committed Nov 21, 2025
commit 01d830e49024bf9bf7b36a325454d89a089bbff8
4 changes: 2 additions & 2 deletions agent/agentsocket/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/coder/coder/v2/agent/agentsocket"
"github.com/coder/coder/v2/agent/agentsocket/proto"
"github.com/coder/coder/v2/agent/unit"
"github.com/coder/coder/v2/codersdk/drpcsdk"
)

// tempDirUnixSocket returns a temporary directory that can safely hold unix
Expand Down Expand Up @@ -58,7 +57,8 @@ func newSocketClient(t *testing.T, socketPath string) proto.DRPCAgentSocketClien
session, err := yamux.Client(conn, config)
require.NoError(t, err)

client := proto.NewDRPCAgentSocketClient(drpcsdk.MultiplexedConn(session))
client, err := agentsocket.NewClient(socketPath, slog.Make().Leveled(slog.LevelDebug))
require.NoError(t, err)

t.Cleanup(func() {
_ = session.Close()
Expand Down
6 changes: 6 additions & 0 deletions agent/agentsocket/socket_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package agentsocket
import (
"net"

"cdr.dev/slog"
"golang.org/x/xerrors"
)

Expand All @@ -25,3 +26,8 @@ func cleanupSocket(_ string) error {
// No-op since agentsocket is not supported on Windows
return nil
}

// NewClient creates a DRPC client for the agent socket at the given path.
func NewClient(path string, logger slog.Logger) (*Client, error) {
return nil, xerrors.New("agentsocket is not supported on Windows")
}
Loading