JuliusBrussee/caveman · error

cachebench: unsupported replay base URL provider

Error message

cachebench: unsupported replay base URL provider %q

What it means

NewHTTPReplayTransport was configured with a BaseURLs entry for a provider outside the supported set (openai/anthropic/gemini/bedrock). The provider name is normalised (trimmed, lowercased) before the check, so the offending key is the raw config value.

Solutions

  1. Remove or correct the unsupported provider key in ReplayHTTPConfig.BaseURLs
  2. Add support for the provider in the transport if genuinely needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cacheengine/cachebench/replay_http.go:81 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/bc97260ae3727a8c. Report an issue: GitHub.

Appendix: source

Thrown at cacheengine/cachebench/replay_http.go:81

	if limit < 1 || limit > 256<<20 {
		return nil, errors.New("cachebench: replay response limit must be between 1 byte and 256 MiB")
	}
	requestTimeout := config.RequestTimeout
	if requestTimeout == 0 {
		requestTimeout = 2 * time.Minute
	}
	if requestTimeout < time.Second || requestTimeout > time.Hour {
		return nil, errors.New("cachebench: replay request timeout must be between 1 second and 1 hour")
	}
	bases := map[string]string{
		"openai":    "https://api.openai.com",
		"anthropic": "https://api.anthropic.com",
		"gemini":    "https://generativelanguage.googleapis.com",
	}
	for provider, value := range config.BaseURLs {
		provider = strings.ToLower(strings.TrimSpace(provider))
		if provider != "openai" && provider != "anthropic" && provider != "gemini" && provider != "bedrock" {
			return nil, fmt.Errorf("cachebench: unsupported replay base URL provider %q", provider)
		}
		bases[provider] = value
	}
	parsed := make(map[string]*url.URL, len(bases))
	for provider, value := range bases {
		base, err := validateReplayBaseURL(value, config.AllowInsecureLoopback)
		if err != nil {
			return nil, fmt.Errorf("cachebench: %s replay base URL: %w", provider, err)
		}
		parsed[provider] = base
	}
	client := config.Client
	if client == nil {
		client = &http.Client{
			Timeout: requestTimeout,
			Transport: &http.Transport{
				Proxy:                 nil,
				DialContext:           (&net.Dialer{Timeout: 10 * time.Second, KeepAlive: 30 * time.Second}).DialContext,

View on GitHub (pinned to 766dce6b13)