{"record":{"id":"528ddc2386521fac","repo":"sipeed/picoclaw","slug":"bot-info-empty-open-id","errorCode":null,"errorMessage":"bot info: empty open_id","messagePattern":"bot info: empty open_id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/channels/feishu/feishu_64.go","lineNumber":733,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"bot info request: %w\", err)\n\t}\n\n\tvar result struct {\n\t\tCode int `json:\"code\"`\n\t\tBot  struct {\n\t\t\tOpenID string `json:\"open_id\"`\n\t\t} `json:\"bot\"`\n\t}\n\tif err := json.Unmarshal(resp.RawBody, &result); err != nil {\n\t\treturn fmt.Errorf(\"bot info parse: %w\", err)\n\t}\n\tif result.Code != 0 {\n\t\tc.invalidateTokenOnAuthError(result.Code)\n\t\treturn fmt.Errorf(\"bot info api error (code=%d)\", result.Code)\n\t}\n\tif result.Bot.OpenID == \"\" {\n\t\treturn fmt.Errorf(\"bot info: empty open_id\")\n\t}\n\n\tc.botOpenID.Store(result.Bot.OpenID)\n\tlogger.InfoCF(\"feishu\", \"Fetched bot open_id from API\", map[string]any{\n\t\t\"open_id\": result.Bot.OpenID,\n\t})\n\treturn nil\n}\n\n// isBotMentioned checks if the bot was @mentioned in the message.\nfunc (c *FeishuChannel) isBotMentioned(message *larkim.EventMessage) bool {\n\tif message.Mentions == nil {\n\t\treturn false\n\t}\n\n\tknownID, ok := c.botOpenID.Load().(string)\n\tif !ok || knownID == \"\" {\n\t\tlogger.DebugCF(\"feishu\", \"Bot open_id unknown, cannot detect @mention\", nil)","sourceCodeStart":715,"sourceCodeEnd":751,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/feishu/feishu_64.go#L715-L751","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the app has 'Robot' (bot) capability enabled in the Feishu console","Ensure the credentials belong to the bot app itself, not an unrelated custom app","Verify SDK version against current Feishu API docs for /bot/v3/info field names","Accept degraded mode (mention detection off) if the channel otherwise works"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"func isEmptyOpenID(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"bot info: empty open_id\")\n}","tryCatchPattern":"err := fetchBotInfo(ctx)\nif isEmptyOpenID(err) {\n\t// success envelope without bot identity: app likely lacks bot capability\n\tlogger.Warn(\"app returned no bot open_id; enable Robot capability or accept degraded mention detection\", \"err\", err)\n\terr = nil // degrade gracefully\n}\nreturn err","preventionTips":["Enable 'Robot' capability for the app in Feishu Open Platform before deploying","Use credentials of the bot app itself, not a management/store app token","Smoke-test the bot-info call in CI with staging credentials","Document degraded mode: without open_id, @mention detection silently weakens"],"tags":["feishu","bot-info","config","degraded","unexpected-response"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}