{"record":{"id":"ea55d2ccc265a9a4","repo":"router-for-me/CLIProxyAPI","slug":"read-host-http-response-w","errorCode":null,"errorMessage":"read host http response: %w","messagePattern":"read host http response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/http_bridge.go","lineNumber":51,"sourceCode":"\t\tctx = context.Background()\n\t}\n\tresp, cfg, errDo := c.doHTTP(ctx, req)\n\tif errDo != nil {\n\t\treturn pluginapi.HTTPResponse{}, errDo\n\t}\n\tdefer func() {\n\t\tif errClose := resp.Body.Close(); errClose != nil {\n\t\t\tlog.Warnf(\"pluginhost: response body close error: %v\", errClose)\n\t\t}\n\t}()\n\thelps.RecordAPIResponseMetadata(ctx, cfg, resp.StatusCode, resp.Header.Clone())\n\tbody, errReadAll := io.ReadAll(resp.Body)\n\tif len(body) > 0 {\n\t\thelps.AppendAPIResponseChunk(ctx, cfg, body)\n\t}\n\tif errReadAll != nil {\n\t\thelps.RecordAPIResponseError(ctx, cfg, errReadAll)\n\t\treturn pluginapi.HTTPResponse{}, fmt.Errorf(\"read host http response: %w\", errReadAll)\n\t}\n\treturn pluginapi.HTTPResponse{\n\t\tStatusCode: resp.StatusCode,\n\t\tHeaders:    cloneHeader(resp.Header),\n\t\tBody:       body,\n\t}, nil\n}\n\nfunc (c *hostHTTPClient) DoStream(ctx context.Context, req pluginapi.HTTPRequest) (pluginapi.HTTPStreamResponse, error) {\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\tresp, cfg, errDo := c.doHTTP(ctx, req)\n\tif errDo != nil {\n\t\treturn pluginapi.HTTPStreamResponse{}, errDo\n\t}\n\thelps.RecordAPIResponseMetadata(ctx, cfg, resp.StatusCode, resp.Header.Clone())\n\tchunks := make(chan pluginapi.HTTPStreamChunk)","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/http_bridge.go#L33-L69","documentation":"Error \"read host http response: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/http_bridge.go:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; the host HTTP response could not be read.","Check for connection resets between the plugin host and the HTTP client."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}