sipeed/picoclaw · warning

bot info: empty open_id

Error message

bot info: empty open_id

What it means

The bot-info call returned success (code 0) but the payload carried no bot.open_id, so the channel refuses to store an empty ID. This is an unexpected-but-successful response: the request reached Feishu and authenticated, yet the envelope lacks the expected field. Start() logs the fetch failure and continues with degraded @mention detection.

Source

Thrown at pkg/channels/feishu/feishu_64.go:733

	if err != nil {
		return fmt.Errorf("bot info request: %w", err)
	}

	var result struct {
		Code int `json:"code"`
		Bot  struct {
			OpenID string `json:"open_id"`
		} `json:"bot"`
	}
	if err := json.Unmarshal(resp.RawBody, &result); err != nil {
		return fmt.Errorf("bot info parse: %w", err)
	}
	if result.Code != 0 {
		c.invalidateTokenOnAuthError(result.Code)
		return fmt.Errorf("bot info api error (code=%d)", result.Code)
	}
	if result.Bot.OpenID == "" {
		return fmt.Errorf("bot info: empty open_id")
	}

	c.botOpenID.Store(result.Bot.OpenID)
	logger.InfoCF("feishu", "Fetched bot open_id from API", map[string]any{
		"open_id": result.Bot.OpenID,
	})
	return nil
}

// isBotMentioned checks if the bot was @mentioned in the message.
func (c *FeishuChannel) isBotMentioned(message *larkim.EventMessage) bool {
	if message.Mentions == nil {
		return false
	}

	knownID, ok := c.botOpenID.Load().(string)
	if !ok || knownID == "" {
		logger.DebugCF("feishu", "Bot open_id unknown, cannot detect @mention", nil)

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Confirm the app has 'Robot' (bot) capability enabled in the Feishu console
  2. Ensure the credentials belong to the bot app itself, not an unrelated custom app
  3. Verify SDK version against current Feishu API docs for /bot/v3/info field names
  4. Accept degraded mode (mention detection off) if the channel otherwise works

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

func isEmptyOpenID(err error) bool {
	return err != nil && strings.Contains(err.Error(), "bot info: empty open_id")
}

Try / catch

err := fetchBotInfo(ctx)
if isEmptyOpenID(err) {
	// success envelope without bot identity: app likely lacks bot capability
	logger.Warn("app returned no bot open_id; enable Robot capability or accept degraded mention detection", "err", err)
	err = nil // degrade gracefully
}
return err

Prevention

When it happens

Trigger: A 200/code-0 response whose bot object is missing or has open_id: null - e.g. an app type that has no bot identity (custom app without bot capability enabled), or an API/SDK version mismatch changing field casing.

Common situations: Bot capability not enabled for the app in Feishu Open Platform; querying with a store/management app token instead of a bot app; SDK drift renaming the JSON field.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/528ddc2386521fac. Report an issue: GitHub.