JuliusBrussee/caveman · error

cachebench: provider, model, and endpoint required

Error message

cachebench: provider, model, and endpoint required

What it means

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.

Solutions

  1. Fill in Provider, Model, and Endpoint with non-empty values on the ProviderConfig
  2. Load provider definitions from configuration rather than constructing partial structs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cacheengine/cachebench/trace.go:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/fcb5b7c67aa61594. Report an issue: GitHub.

Appendix: source

Thrown at cacheengine/cachebench/trace.go:88

				Text: fmt.Sprintf("call workspace inspection for turn %d", turn+1), Tokens: scenario.AssistantTokens,
			},
			agentMessage{
				ID: fmt.Sprintf("turn-%03d-tool-result", turn+1), Kind: "tool_result", Turn: turn + 1,
				Text:   fixtureText(fmt.Sprintf("workspace result turn %d", turn+1), scenario.ToolResultTokens),
				Tokens: scenario.ToolResultTokens,
			},
		)
	}
	return Trace{
		Provider: provider, Scenario: scenario, Requests: requests,
		TokenBasis:  "deterministic declared fixture tokens; provider counts required for observed evidence",
		TimingBasis: TimingSynthetic,
	}, nil
}

func validateScenario(provider ProviderConfig, scenario Scenario) error {
	if strings.TrimSpace(provider.Provider) == "" || strings.TrimSpace(provider.Model) == "" || strings.TrimSpace(provider.Endpoint) == "" {
		return errors.New("cachebench: provider, model, and endpoint required")
	}
	if scenario.Turns < 2 || scenario.StaticTokens <= 0 || scenario.UserTokens <= 0 || scenario.AssistantTokens < 0 || scenario.ToolResultTokens < 0 || scenario.SummaryTokens < 0 {
		return errors.New("cachebench: invalid scenario token or turn count")
	}
	if scenario.CompactionEvery < 0 || scenario.Step <= 0 || scenario.AssumedTTL <= 0 {
		return errors.New("cachebench: invalid scenario timing")
	}
	return nil
}

func nativeRequest(provider ProviderConfig, scenario Scenario, epoch string, body []byte) cacheengine.NativeRequest {
	expectedCalls := scenario.Turns
	if scenario.CompactionEvery > 0 && expectedCalls > scenario.CompactionEvery {
		expectedCalls = scenario.CompactionEvery
	}
	return cacheengine.NativeRequest{
		Scope: "cachebench/real-agent", Epoch: epoch, PartitionKey: "agent-session-1",
		ExpectedRequestsPerMinute: 20, ExpectedCalls: expectedCalls,

View on GitHub (pinned to 766dce6b13)