sipeed/picoclaw · error

invalid in chatID

Error message

invalid %s in chatID: %s

What it means

A validation in OneBotChannel.buildSendRequest: the numeric ID portion of the chatID cannot be parsed with strconv.ParseInt, so the OneBot action parameters cannot be built; the malformed chatID is included in the error.

Solutions

  1. Ensure chat_ids are created only from OneBot group_id/user_id integers
  2. Validate chat_id format before dispatching outbound messages
  3. Fix the stored chat ID; retries will keep failing
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/channels/onebot/onebot.go:600 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/34d73284eff0f2be. Report an issue: GitHub.

Appendix: source

Thrown at pkg/channels/onebot/onebot.go:600

}

func (c *OneBotChannel) buildSendRequest(msg bus.OutboundMessage) (string, any, error) {
	chatID := msg.ChatID
	segments := c.buildMessageSegments(chatID, msg.Content)

	var action, idKey string
	var rawID string
	if rest, ok := strings.CutPrefix(chatID, "group:"); ok {
		action, idKey, rawID = "send_group_msg", "group_id", rest
	} else if rest, ok := strings.CutPrefix(chatID, "private:"); ok {
		action, idKey, rawID = "send_private_msg", "user_id", rest
	} else {
		action, idKey, rawID = "send_private_msg", "user_id", chatID
	}

	id, err := strconv.ParseInt(rawID, 10, 64)
	if err != nil {
		return "", nil, fmt.Errorf("invalid %s in chatID: %s", idKey, chatID)
	}
	return action, map[string]any{idKey: id, "message": segments}, nil
}

func (c *OneBotChannel) listen() {
	c.mu.Lock()
	conn := c.conn
	c.mu.Unlock()

	if conn == nil {
		logger.WarnC("onebot", "WebSocket connection is nil, listener exiting")
		return
	}

	for {
		select {
		case <-c.ctx.Done():
			return

View on GitHub (pinned to 49183d7e8d)