{"record":{"id":"58b65db19260718a","repo":"chenhg5/cc-connect","slug":"wps-agentspace-sendimage-invalid-reply-context-t","errorCode":null,"errorMessage":"wps-agentspace: SendImage: invalid reply context type %T","messagePattern":"wps-agentspace: SendImage: invalid reply context type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wps-agentspace/wpsagentspace.go","lineNumber":238,"sourceCode":"\trc, ok := replyCtx.(*replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"wps-agentspace: SendFile: invalid reply context type %T\", replyCtx)\n\t}\n\n\tpath, err := p.saveAttachment(file.FileName, file.Data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"wps-agentspace: SendFile: %w\", err)\n\t}\n\n\tnotice := fmt.Sprintf(\"📎 文件已保存到本地：\\n%s\", path)\n\treturn p.sendText(rc.ChatID, notice, rc)\n}\n\n// SendImage implements core.ImageSender. Same disk-persist fallback as SendFile.\nfunc (p *Platform) SendImage(ctx context.Context, replyCtx any, img core.ImageAttachment) error {\n\trc, ok := replyCtx.(*replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"wps-agentspace: SendImage: invalid reply context type %T\", replyCtx)\n\t}\n\n\tname := img.FileName\n\tif name == \"\" {\n\t\text := \".png\"\n\t\tif strings.HasPrefix(img.MimeType, \"image/jpeg\") {\n\t\t\text = \".jpg\"\n\t\t} else if strings.HasPrefix(img.MimeType, \"image/gif\") {\n\t\t\text = \".gif\"\n\t\t} else if strings.HasPrefix(img.MimeType, \"image/webp\") {\n\t\t\text = \".webp\"\n\t\t}\n\t\tname = \"image_\" + time.Now().Format(\"20060102_150405\") + ext\n\t}\n\n\tpath, err := p.saveAttachment(name, img.Data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"wps-agentspace: SendImage: %w\", err)","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wps-agentspace/wpsagentspace.go#L220-L256","documentation":"Type-assertion guard in wps-agentspace SendImage: replyCtx is not the platform's *replyContext type, so the ChatID to deliver the disk-persisted image notice to is unknown.","triggerScenarios":"Thrown at platform/wps-agentspace/wpsagentspace.go:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Forward the *replyContext produced by the platform's inbound handler","Route contexts per-platform in the engine so WPS contexts never reach other senders"],"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"}