{"record":{"id":"2edda07396bdd9b7","repo":"charmbracelet/crush","slug":"failed-to-set-permissions-skip-requests-w","errorCode":null,"errorMessage":"failed to set permissions skip requests: %w","messagePattern":"failed to set permissions skip requests: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/client/proto.go","lineNumber":738,"sourceCode":"\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to cancel question batch: %w\", err)\n\t}\n\tdefer rsp.Body.Close()\n\tif rsp.StatusCode != http.StatusOK {\n\t\treturn false, fmt.Errorf(\"failed to cancel question batch: status code %d\", rsp.StatusCode)\n\t}\n\tvar resp proto.QuestionAnswerResponse\n\tif err := json.NewDecoder(rsp.Body).Decode(&resp); err != nil {\n\t\treturn false, fmt.Errorf(\"failed to decode cancel question batch response: %w\", err)\n\t}\n\treturn resp.Resolved, nil\n}\n\n// SetPermissionsSkipRequests sets the skip-requests flag for a workspace.\nfunc (c *Client) SetPermissionsSkipRequests(ctx context.Context, id string, skip bool) error {\n\trsp, err := c.post(ctx, fmt.Sprintf(\"/workspaces/%s/permissions/skip\", id), nil, jsonBody(proto.PermissionSkipRequest{Skip: skip}), http.Header{\"Content-Type\": []string{\"application/json\"}})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set permissions skip requests: %w\", err)\n\t}\n\tdefer rsp.Body.Close()\n\tif rsp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"failed to set permissions skip requests: status code %d\", rsp.StatusCode)\n\t}\n\treturn nil\n}\n\n// GetPermissionsSkipRequests retrieves the skip-requests flag for a workspace.\nfunc (c *Client) GetPermissionsSkipRequests(ctx context.Context, id string) (bool, error) {\n\trsp, err := c.get(ctx, fmt.Sprintf(\"/workspaces/%s/permissions/skip\", id), nil, nil)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to get permissions skip requests: %w\", err)\n\t}\n\tdefer rsp.Body.Close()\n\tif rsp.StatusCode != http.StatusOK {\n\t\treturn false, fmt.Errorf(\"failed to get permissions skip requests: status code %d\", rsp.StatusCode)\n\t}","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/client/proto.go#L720-L756","documentation":"SetPermissionsSkipRequests POSTs to /workspaces/{id}/permissions/skip to toggle the skip-permission-requests flag. This error wraps transport-level failures from c.post — the request never completed, so the skip flag was not changed on the server.","triggerScenarios":"Calling SetPermissionsSkipRequests when the server is down/unreachable, DNS or TLS fails, the network drops, or ctx is cancelled mid-request.","commonSituations":"Toggling auto-approve while offline; server restarted between UI action and call; misconfigured server address; short context deadline on slow networks.","solutions":["Verify the server is reachable and the base URL/port is correct, then retry the call.","Check network/VPN/proxy connectivity if the failure is intermittent.","Increase the context deadline if requests are timing out.","Confirm the flag took effect by reading workspace state after a successful call."],"exampleFix":"// before\nerr := client.SetPermissionsSkipRequests(ctx, wsID, true)\n// after\nerr := client.SetPermissionsSkipRequests(ctx, wsID, true)\nif err != nil {\n\treturn fmt.Errorf(\"toggling skip-permission-requests for %s: %w\", wsID, err)\n}","handlingStrategy":"retry","validationCode":"// Verify connectivity before toggling the skip flag\nif err := serverReachable(ctx, baseURL); err != nil {\n\treturn fmt.Errorf(\"skip flag not changed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := client.SetPermissionsSkipRequests(ctx, wsID, true)\nif err != nil {\n\tif errors.Is(err, context.DeadlineExceeded) {\n\t\treturn retrySetSkip(ctx, wsID, true, 3) // idempotent flag set\n\t}\n\treturn fmt.Errorf(\"setting skip-requests: %w\", err)\n}","preventionTips":["Setting the flag is idempotent — safe to retry on transport errors","Health-check the server before toggling permission behavior","Avoid cancelling the context mid-toggle; use an adequate timeout","Read back workspace state after the call to confirm the flag stuck"],"tags":["http-client","network","permissions","configuration"],"backgroundTag":"http-request-failed","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}