{"record":{"id":"0e9b5a5855fb10fd","repo":"JuliusBrussee/caveman","slug":"cachebench-provider-response-exceeds-configured-l","errorCode":null,"errorMessage":"cachebench: provider response exceeds configured limit","messagePattern":"cachebench: provider response exceeds configured limit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay_http.go","lineNumber":157,"sourceCode":"\t\treturn ReplayResponse{}, errors.New(\"cachebench: could not build provider request\")\n\t}\n\trequest.Header.Set(\"content-type\", \"application/json\")\n\trequest.Header.Set(\"accept\", \"application/json\")\n\trequest.Header.Set(\"user-agent\", \"caveman-cachebench-replay/1\")\n\tif err := transport.authorize(provider, outbound.Region, request, outbound.Body); err != nil {\n\t\treturn ReplayResponse{}, err\n\t}\n\tresponse, err := transport.client.Do(request)\n\tif err != nil {\n\t\treturn ReplayResponse{}, errors.New(\"cachebench: provider request failed\")\n\t}\n\tdefer response.Body.Close()\n\tbody, err := io.ReadAll(io.LimitReader(response.Body, transport.maxResponseBytes+1))\n\tif err != nil {\n\t\treturn ReplayResponse{StatusCode: response.StatusCode}, errors.New(\"cachebench: provider response read failed\")\n\t}\n\tif int64(len(body)) > transport.maxResponseBytes {\n\t\treturn ReplayResponse{StatusCode: response.StatusCode}, errors.New(\"cachebench: provider response exceeds configured limit\")\n\t}\n\treturn ReplayResponse{\n\t\tStatusCode: response.StatusCode, Body: body,\n\t\tProviderRequestID: providerRequestID(response.Header),\n\t}, nil\n}\n\nfunc (transport *HTTPReplayTransport) endpoint(provider string, outbound ReplayOutbound) (*url.URL, error) {\n\tif !validBoundedText(outbound.Model, 512, false) {\n\t\treturn nil, errors.New(\"cachebench: invalid replay model\")\n\t}\n\tbase := transport.baseURLs[provider]\n\tif provider == \"bedrock\" && base == nil {\n\t\tif !validAWSRegion(outbound.Region) {\n\t\t\treturn nil, errors.New(\"cachebench: invalid Bedrock region\")\n\t\t}\n\t\tparsed, _ := url.Parse(\"https://bedrock-runtime.\" + outbound.Region + \".amazonaws.com\")\n\t\tbase = parsed","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay_http.go#L139-L175","documentation":"The provider response body is larger than maxResponseBytes, the response size cap set at transport construction. The body is read through a LimitReader of maxResponseBytes+1 so that a length strictly greater than the cap is detectable; hitting that sentinel byte means the provider returned an oversized payload and it is rejected rather than buffered in full.","triggerScenarios":"Thrown at cacheengine/cachebench/replay_http.go:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise maxResponseBytes (≤256 MiB) if responses are legitimately large","Reduce the replay prompt/context size"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}