sipeed/picoclaw · error
error creating provider
Error message
error creating provider: %w
What it means
Context wrapper in agentCmd around providers.CreateProvider: a provider was constructed from the (possibly model-overridden) config but initialization failed — commonly an unknown provider/model entry, missing API credentials, or an invalid endpoint. The wrapped error names the exact provider-layer cause; this wrapper locates it in the agent bootstrap.
Solutions
- Read the wrapped provider error to identify the bad config field
- Ensure the model name passed via --model exists in the configured ModelList
- Complete provider auth (picoclaw auth login --provider <name>) or set the required API key
- Fix typos in provider/model identifiers in the config file
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at cmd/picoclaw/internal/agent/helpers.go:44 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/215597ebe61dc3e6.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/picoclaw/internal/agent/helpers.go:44
cfg, err := internal.LoadConfig()
if err != nil {
return fmt.Errorf("error loading config: %w", err)
}
logger.ConfigureFromEnv()
if debug {
logger.SetLevel(logger.DEBUG)
fmt.Println("🔍 Debug mode enabled")
}
if model != "" {
cfg.Agents.Defaults.ModelName = model
}
provider, modelID, err := providers.CreateProvider(cfg)
if err != nil {
return fmt.Errorf("error creating provider: %w", err)
}
// Use the resolved model ID from provider creation
if modelID != "" {
cfg.Agents.Defaults.ModelName = modelID
}
msgBus := bus.NewMessageBus()
defer msgBus.Close()
agentLoop := agent.NewAgentLoop(cfg, msgBus, provider)
defer agentLoop.Close()
// Print agent startup info (only for interactive mode)
startupInfo := agentLoop.GetStartupInfo()
toolsInfo, ok := startupInfo["tools"].(map[string]any)
if !ok {
toolsInfo = nil
}View on GitHub (pinned to 49183d7e8d)