{"record":{"id":"858b6401e7be1c91","repo":"sipeed/picoclaw","slug":"telegram-send-w","errorCode":null,"errorMessage":"telegram send: %w","messagePattern":"telegram send: %w","errorType":"exception","errorClass":"ErrTemporary","httpStatus":null,"severity":"error","filePath":"pkg/channels/telegram/telegram.go","lineNumber":392,"sourceCode":"\t}\n\n\tif params.replyToID != \"\" {\n\t\tif mid, parseErr := strconv.Atoi(params.replyToID); parseErr == nil {\n\t\t\ttgMsg.ReplyParameters = &telego.ReplyParameters{\n\t\t\t\tMessageID: mid,\n\t\t\t}\n\t\t}\n\t}\n\n\tpMsg, err := c.bot.SendMessage(ctx, tgMsg)\n\tif err != nil {\n\t\tlogParseFailed(err, params.useMarkdownV2)\n\n\t\ttgMsg.Text = params.mdFallback\n\t\ttgMsg.ParseMode = \"\"\n\t\tpMsg, err = c.bot.SendMessage(ctx, tgMsg)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"telegram send: %w\", channels.ErrTemporary)\n\t\t}\n\t}\n\n\treturn strconv.Itoa(pMsg.MessageID), nil\n}\n\n// maxTypingDuration limits how long the typing indicator can run.\n// Prevents endless typing when the LLM fails/hangs and preSend never invokes cancel.\n// Matches channels.Manager's typingStopTTL (5 min) so behavior is consistent.\nconst maxTypingDuration = 5 * time.Minute\n\n// StartTyping implements channels.TypingCapable.\n// It sends ChatAction(typing) immediately and then repeats every 4 seconds\n// (Telegram's typing indicator expires after ~5s) in a background goroutine.\n// The returned stop function is idempotent and cancels the goroutine.\n// The goroutine also exits automatically after maxTypingDuration if cancel is\n// never called (e.g. when the LLM fails or times out without publishing).\nfunc (c *TelegramChannel) StartTyping(ctx context.Context, chatID string) (func(), error) {","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/telegram/telegram.go#L374-L410","documentation":"Returned by sendChunk after a double failure: the initial SendMessage errored (usually markdown parse issues), logParseFailed ran, and the retry with the plain-text fallback also failed. The final error wraps channels.ErrTemporary, marking the failure transient so callers can retry rather than drop the message.","triggerScenarios":"Thrown at pkg/channels/telegram/telegram.go:392 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry after backoff — the error is classified as temporary (network blip or rate limit)","Check for 429 rate limiting from Telegram and slow down send volume","If persistent, verify network connectivity and bot token validity","Check logs from the first attempt to see whether markdown parsing forced the fallback path"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}