{"record":{"id":"d6d09426b67dc548","repo":"sipeed/picoclaw","slug":"invalid-thread-id-in-chat-id-q-w","errorCode":null,"errorMessage":"invalid thread ID in chat ID %q: %w","messagePattern":"invalid thread ID in chat ID %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/telegram/telegram.go","lineNumber":1519,"sourceCode":"func (c *TelegramChannel) ToolFeedbackMessageChatID(chatID string, outboundCtx *bus.InboundContext) string {\n\treturn telegramToolFeedbackChatKey(chatID, outboundCtx)\n}\n\n// parseTelegramChatID splits \"chatID/threadID\" into its components.\n// Returns threadID=0 when no \"/\" is present (non-forum messages).\nfunc parseTelegramChatID(chatID string) (int64, int, error) {\n\tidx := strings.Index(chatID, \"/\")\n\tif idx == -1 {\n\t\tcid, err := strconv.ParseInt(chatID, 10, 64)\n\t\treturn cid, 0, err\n\t}\n\tcid, err := strconv.ParseInt(chatID[:idx], 10, 64)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\ttid, err := strconv.Atoi(chatID[idx+1:])\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"invalid thread ID in chat ID %q: %w\", chatID, err)\n\t}\n\treturn cid, tid, nil\n}\n\nfunc resolveTelegramOutboundTarget(chatID string, outboundCtx *bus.InboundContext) (int64, int, error) {\n\ttargetChatID := strings.TrimSpace(chatID)\n\tif targetChatID == \"\" && outboundCtx != nil {\n\t\ttargetChatID = strings.TrimSpace(outboundCtx.ChatID)\n\t}\n\tresolvedChatID, resolvedThreadID, err := parseTelegramChatID(targetChatID)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif resolvedThreadID != 0 || outboundCtx == nil {\n\t\treturn resolvedChatID, resolvedThreadID, nil\n\t}\n\ttopicID := strings.TrimSpace(outboundCtx.TopicID)\n\tif topicID == \"\" {","sourceCodeStart":1501,"sourceCodeEnd":1537,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/telegram/telegram.go#L1501-L1537","documentation":"Error \"invalid thread ID in chat ID %q: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/telegram/telegram.go:1519 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}