{"record":{"id":"de60572c03c1fc21","repo":"sipeed/picoclaw","slug":"invalid-chat-id-s-w","errorCode":null,"errorMessage":"invalid chat ID %s: %w","messagePattern":"invalid chat ID (.+?): %w","errorType":"validation","errorClass":"ErrSendFailed","httpStatus":null,"severity":"error","filePath":"pkg/channels/telegram/telegram.go","lineNumber":227,"sourceCode":"\t\tc.progress.StopAll()\n\t}\n\tif c.commandRegCancel != nil {\n\t\tc.commandRegCancel()\n\t}\n\n\treturn nil\n}\n\nfunc (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]string, error) {\n\tif !c.IsRunning() {\n\t\treturn nil, channels.ErrNotRunning\n\t}\n\n\tuseMarkdownV2 := c.tgCfg.UseMarkdownV2\n\n\tchatID, threadID, err := resolveTelegramOutboundTarget(msg.ChatID, &msg.Context)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid chat ID %s: %w\", msg.ChatID, channels.ErrSendFailed)\n\t}\n\n\tif msg.Content == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tisToolFeedback := outboundMessageIsToolFeedback(msg)\n\ttoolFeedbackContent := msg.Content\n\tif isToolFeedback {\n\t\ttoolFeedbackContent = fitToolFeedbackForTelegram(msg.Content, useMarkdownV2, 4096)\n\t}\n\ttrackedChatID := telegramToolFeedbackChatKey(msg.ChatID, &msg.Context)\n\tif isToolFeedback {\n\t\tif msgID, handled, err := c.progress.Update(ctx, trackedChatID, toolFeedbackContent); handled {\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn []string{msgID}, nil","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/telegram/telegram.go#L209-L245","documentation":"Guard in TelegramChannel.Send: resolveTelegramOutboundTarget could not resolve the outbound chat ID to a chat the bot may message (unparseable numeric ID, cross-chat target denied by default policy, or non-numeric recipient without session scope). The real resolution error is discarded and replaced with the sentinel channels.ErrSendFailed, so the %w wraps a generic failure rather than the cause.","triggerScenarios":"Thrown at pkg/channels/telegram/telegram.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm msg.ChatID is a valid Telegram chat ID (numeric, possibly \"chatID/threadID\" for forums)","For cross-chat sends, configure explicit allow rules — numeric targets outside the session are denied by default","Ensure inbound sessions established recipient scope before sending to non-numeric identifiers"],"exampleFix":null,"handlingStrategy":"validation","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"}