{"record":{"id":"6c9f7151947e753e","repo":"chenhg5/cc-connect","slug":"wps-agentspace-sendfile-w","errorCode":null,"errorMessage":"wps-agentspace: SendFile: %w","messagePattern":"wps-agentspace: SendFile: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wps-agentspace/wpsagentspace.go","lineNumber":227,"sourceCode":"\trc, ok := replyCtx.(*replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"wps-agentspace: invalid reply context type\")\n\t}\n\treturn p.sendText(rc.ChatID, content, rc)\n}\n\n// SendFile implements core.FileSender. The WPS Agentspace WebSocket protocol\n// has no native binary file frame, so we persist the file to a shared\n// directory and reply with a path the user can open locally.\nfunc (p *Platform) SendFile(ctx context.Context, replyCtx any, file core.FileAttachment) error {\n\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\"","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wps-agentspace/wpsagentspace.go#L209-L245","documentation":"Wrapped error from saveAttachment when handling SendFile: persisting the attachment bytes to the shared directory failed (disk full, permission denied, unwritable path), so no local path notice can be sent to the chat.","triggerScenarios":"Thrown at platform/wps-agentspace/wpsagentspace.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the shared attachment directory exists and is writable by the service user","Free disk space or raise quotas on the volume backing the shared directory","Verify the configured save path is absolute and not read-only (e.g. not inside a container mount lacking write perms)","Log the failing path alongside the error to pinpoint which mount is at fault"],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}