sipeed/picoclaw · error

error processing message

Error message

error processing message: %w

What it means

Context wrapper in agentCmd around agentLoop.ProcessDirect: the interactive/one-shot message was submitted to an already-initialized agent loop, but the turn failed mid-processing — the wrapped cause may be an LLM/provider call failure, context cancellation, or an internal agent error. The agent, bus, and provider were all set up successfully before this point.

Solutions

  1. Inspect the wrapped error to tell provider/network failures from agent-internal ones
  2. Check that the model endpoint is reachable and credentials are valid
  3. Retry the message — transient provider errors (rate limits, timeouts) often clear
  4. For one-shot use, wrap the call site in a retry with a small backoff
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/picoclaw/internal/agent/helpers.go:81 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/a77578ab746e5646. Report an issue: GitHub.

Appendix: source

Thrown at cmd/picoclaw/internal/agent/helpers.go:81

	skillsInfo, ok := startupInfo["skills"].(map[string]any)
	if !ok {
		skillsInfo = nil
	}
	logFields := map[string]any{}
	if toolsInfo != nil {
		logFields["tools_count"] = toolsInfo["count"]
	}
	if skillsInfo != nil {
		logFields["skills_total"] = skillsInfo["total"]
		logFields["skills_available"] = skillsInfo["available"]
	}
	logger.InfoCF("agent", "Agent initialized", logFields)

	if message != "" {
		ctx := context.Background()
		response, err := agentLoop.ProcessDirect(ctx, message, sessionKey)
		if err != nil {
			return fmt.Errorf("error processing message: %w", err)
		}
		fmt.Printf("\n%s %s\n", internal.Logo, response)
		return nil
	}

	fmt.Printf("%s Interactive mode (Ctrl+C to exit)\n\n", internal.Logo)
	interactiveMode(agentLoop, sessionKey)

	return nil
}

func interactiveMode(agentLoop *agent.AgentLoop, sessionKey string) {
	prompt := fmt.Sprintf("%s You: ", internal.Logo)

	rl, err := readline.NewEx(&readline.Config{
		Prompt:          prompt,
		HistoryFile:     filepath.Join(os.TempDir(), ".picoclaw_history"),
		HistoryLimit:    100,

View on GitHub (pinned to 49183d7e8d)