{"record":{"id":"9302d85dc215d732","repo":"chenhg5/cc-connect","slug":"s-sendimage-invalid-reply-context-type-t","errorCode":null,"errorMessage":"%s: SendImage: invalid reply context type %T","messagePattern":"(.+?): SendImage: invalid reply context type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":3266,"sourceCode":"\tif strings.TrimSpace(footer) == \"\" || strings.Contains(content, `<at user_id=`) || strings.Contains(content, `<at id=`) {\n\t\tif strings.TrimSpace(footer) != \"\" {\n\t\t\tcontent += \"\\n\\n\" + footer\n\t\t}\n\t\treturn p.Send(ctx, rctx, content)\n\t}\n\tprocessedBody := sanitizeMarkdownURLs(preprocessFeishuMarkdown(content))\n\tprocessedFooter := sanitizeMarkdownURLs(preprocessFeishuMarkdown(footer))\n\tcardJSON := buildCardJSONWithStatusFooter(processedBody, processedFooter)\n\tif p.shouldUseThreadOrReplyAPI(rc) {\n\t\treturn p.replyMessage(ctx, rc, larkim.MsgTypeInteractive, cardJSON)\n\t}\n\treturn p.sendNewMessageToChat(ctx, rc, larkim.MsgTypeInteractive, cardJSON)\n}\n\nfunc (p *Platform) SendImage(ctx context.Context, rctx any, img core.ImageAttachment) error {\n\trc, ok := rctx.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"%s: SendImage: invalid reply context type %T\", p.tag(), rctx)\n\t}\n\n\timageKey, err := p.uploadImageKey(ctx, img.Data)\n\tif err != nil {\n\t\treturn err\n\t}\n\timageContent, err := (&larkim.MessageImage{ImageKey: imageKey}).String()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s: build image message: %w\", p.tag(), err)\n\t}\n\n\treturn p.sendMediaMessage(ctx, rc, larkim.MsgTypeImage, imageContent)\n}\n\nfunc (p *Platform) uploadImageKey(ctx context.Context, data []byte) (string, error) {\n\tvar uploadResp *larkim.CreateImageResp\n\tif err := p.withTransientRetry(ctx, \"upload image\", func() error {\n\t\treturn p.withFreshTenantAccessTokenRetry(ctx, \"upload image\", func(client *lark.Client, options ...larkcore.RequestOptionFunc) error {","sourceCodeStart":3248,"sourceCodeEnd":3284,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L3248-L3284","documentation":"SendImage received a reply context that is not the feishu replyContext struct — a type-guard failure meaning an internal caller passed the wrong rctx shape. The offending dynamic type is reported via %T.","triggerScenarios":"Thrown at platform/feishu/feishu.go:3266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a reply context produced by the Feishu platform itself"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}