{"record":{"id":"590c39130e61549d","repo":"JuliusBrussee/caveman","slug":"cachebench-unsupported-gemini-replay-endpoint","errorCode":null,"errorMessage":"cachebench: unsupported Gemini replay endpoint","messagePattern":"cachebench: unsupported Gemini replay endpoint","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay_http.go","lineNumber":194,"sourceCode":"\t}\n\tif base == nil {\n\t\treturn nil, fmt.Errorf(\"cachebench: unsupported replay provider %q\", provider)\n\t}\n\tvar path, rawPath string\n\tswitch provider {\n\tcase \"openai\":\n\t\tif outbound.Endpoint != \"/v1/chat/completions\" && outbound.Endpoint != \"/v1/responses\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported OpenAI replay endpoint\")\n\t\t}\n\t\tpath = outbound.Endpoint\n\tcase \"anthropic\":\n\t\tif outbound.Endpoint != \"/v1/messages\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Anthropic replay endpoint\")\n\t\t}\n\t\tpath = outbound.Endpoint\n\tcase \"gemini\":\n\t\tif outbound.Endpoint != \"generateContent\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Gemini replay endpoint\")\n\t\t}\n\t\trawPath = \"/v1beta/models/\" + url.PathEscape(outbound.Model) + \":generateContent\"\n\tcase \"bedrock\":\n\t\tif outbound.Endpoint != \"converse\" || !validAWSRegion(outbound.Region) {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Bedrock replay endpoint or region\")\n\t\t}\n\t\trawPath = \"/model/\" + url.PathEscape(outbound.Model) + \"/converse\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"cachebench: unsupported replay provider %q\", provider)\n\t}\n\tresolved := *base\n\tif rawPath == \"\" {\n\t\tresolved.Path = strings.TrimRight(base.Path, \"/\") + path\n\t\tresolved.RawPath = \"\"\n\t} else {\n\t\tresolved.RawPath = strings.TrimRight(base.EscapedPath(), \"/\") + rawPath\n\t\tresolved.Path, _ = url.PathUnescape(resolved.RawPath)\n\t}","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay_http.go#L176-L212","documentation":"endpoint whitelists the Gemini path: outbound.Endpoint must be exactly the literal 'generateContent' (the model-specific prefix /v1beta/models/<model>: is built by the transport itself). Any other value is rejected, so arbitrary Gemini API paths cannot be reached through replay.","triggerScenarios":"Thrown at cacheengine/cachebench/replay_http.go:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replay only generateContent captures","Extend the allowlist for other Gemini operations"],"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"}