diff --git a/workspace-server/internal/handlers/github_token.go b/workspace-server/internal/handlers/github_token.go index ce9492a9d..f00714a96 100644 --- a/workspace-server/internal/handlers/github_token.go +++ b/workspace-server/internal/handlers/github_token.go @@ -159,7 +159,8 @@ func generateAppInstallationToken() (string, time.Time, error) { req, _ := http.NewRequest("POST", fmt.Sprintf("https://api.github.com/app/installations/%d/access_tokens", installID), nil) req.Header.Set("Authorization", "Bearer "+signed) req.Header.Set("Accept", "application/vnd.github+json") - resp, err := http.DefaultClient.Do(req) + client := &http.Client{Timeout: 30 * time.Second} + resp, err := client.Do(req) if err != nil { return "", time.Time{}, err } diff --git a/workspace-server/internal/handlers/workspace_compute_test.go b/workspace-server/internal/handlers/workspace_compute_test.go index 97ffc4132..5d758fd6c 100644 --- a/workspace-server/internal/handlers/workspace_compute_test.go +++ b/workspace-server/internal/handlers/workspace_compute_test.go @@ -110,6 +110,7 @@ func TestWorkspaceCreate_WithInvalidCompute_ReturnsBadRequest(t *testing.T) { c, _ := gin.CreateTestContext(w) body := `{ "name":"Oversized Agent", + "model":"gpt-4", "compute":{"instance_type":"p4d.24xlarge"} }` c.Request = httptest.NewRequest("POST", "/workspaces", bytes.NewBufferString(body))