sipeed/picoclaw · error
--timeout must be > 0, got
Error message
--timeout must be > 0, got %d
What it means
Validation guard in buildLLMOptions: the --timeout flag (LLM request timeout in seconds) was set to zero or a negative number, which would produce an invalid/instantly-expiring HTTP client timeout. The %d shows the rejected value; the check fires after model resolution, before any client is built.
Solutions
- Set --timeout to a positive number of seconds (e.g. 120 for slow reasoning models)
- Omit the flag to keep the compiled-in default if one exists
- Add flag validation at parse time so cobra rejects the value with usage text
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cmd/membench/main.go:350 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/9b119c5303e79e91.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/membench/main.go:350
//
// MEMBENCH_API_BASE – OpenAI-compatible base URL (default http://127.0.0.1:8080/v1)
// MEMBENCH_API_KEY – Bearer token for the endpoint
// MEMBENCH_MODEL – Model name to send in the request
func buildLLMOptions() (LLMClientOptions, error) {
base := envOrFlag(flagAPIBase, "MEMBENCH_API_BASE")
if base == "" {
base = "http://127.0.0.1:8080/v1"
}
model := envOrFlag(flagModel, "MEMBENCH_MODEL")
if model == "" {
return LLMClientOptions{}, fmt.Errorf(
"--model or MEMBENCH_MODEL is required for LLM eval mode",
)
}
apiKey := envOrFlag(flagAPIKey, "MEMBENCH_API_KEY")
if flagTimeout <= 0 {
return LLMClientOptions{}, fmt.Errorf("--timeout must be > 0, got %d", flagTimeout)
}
return LLMClientOptions{
BaseURL: base,
Model: model,
APIKey: apiKey,
NoThinking: flagNoThinking,
Timeout: time.Duration(flagTimeout) * time.Second,
MaxRetries: flagRetries,
}, nil
}
View on GitHub (pinned to 49183d7e8d)