{"record":{"id":"fcb5b7c67aa61594","repo":"JuliusBrussee/caveman","slug":"cachebench-provider-model-and-endpoint-required","errorCode":null,"errorMessage":"cachebench: provider, model, and endpoint required","messagePattern":"cachebench: provider, model, and endpoint required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/trace.go","lineNumber":88,"sourceCode":"\t\t\t\tText: fmt.Sprintf(\"call workspace inspection for turn %d\", turn+1), Tokens: scenario.AssistantTokens,\n\t\t\t},\n\t\t\tagentMessage{\n\t\t\t\tID: fmt.Sprintf(\"turn-%03d-tool-result\", turn+1), Kind: \"tool_result\", Turn: turn + 1,\n\t\t\t\tText:   fixtureText(fmt.Sprintf(\"workspace result turn %d\", turn+1), scenario.ToolResultTokens),\n\t\t\t\tTokens: scenario.ToolResultTokens,\n\t\t\t},\n\t\t)\n\t}\n\treturn Trace{\n\t\tProvider: provider, Scenario: scenario, Requests: requests,\n\t\tTokenBasis:  \"deterministic declared fixture tokens; provider counts required for observed evidence\",\n\t\tTimingBasis: TimingSynthetic,\n\t}, nil\n}\n\nfunc validateScenario(provider ProviderConfig, scenario Scenario) error {\n\tif strings.TrimSpace(provider.Provider) == \"\" || strings.TrimSpace(provider.Model) == \"\" || strings.TrimSpace(provider.Endpoint) == \"\" {\n\t\treturn errors.New(\"cachebench: provider, model, and endpoint required\")\n\t}\n\tif scenario.Turns < 2 || scenario.StaticTokens <= 0 || scenario.UserTokens <= 0 || scenario.AssistantTokens < 0 || scenario.ToolResultTokens < 0 || scenario.SummaryTokens < 0 {\n\t\treturn errors.New(\"cachebench: invalid scenario token or turn count\")\n\t}\n\tif scenario.CompactionEvery < 0 || scenario.Step <= 0 || scenario.AssumedTTL <= 0 {\n\t\treturn errors.New(\"cachebench: invalid scenario timing\")\n\t}\n\treturn nil\n}\n\nfunc nativeRequest(provider ProviderConfig, scenario Scenario, epoch string, body []byte) cacheengine.NativeRequest {\n\texpectedCalls := scenario.Turns\n\tif scenario.CompactionEvery > 0 && expectedCalls > scenario.CompactionEvery {\n\t\texpectedCalls = scenario.CompactionEvery\n\t}\n\treturn cacheengine.NativeRequest{\n\t\tScope: \"cachebench/real-agent\", Epoch: epoch, PartitionKey: \"agent-session-1\",\n\t\tExpectedRequestsPerMinute: 20, ExpectedCalls: expectedCalls,","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/trace.go#L70-L106","documentation":"validateScenario found an empty (whitespace-only) provider name, model, or endpoint on the ProviderConfig passed to GenerateTrace. All three identify the simulated provider and its cache behavior, so blanks are rejected before trace generation.","triggerScenarios":"Thrown at cacheengine/cachebench/trace.go:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fill in Provider, Model, and Endpoint with non-empty values on the ProviderConfig","Load provider definitions from configuration rather than constructing partial structs"],"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"}