{"record":{"id":"eb5df4e3658fb91d","repo":"multica-ai/multica","slug":"write-task-id-field-w","errorCode":null,"errorMessage":"write task_id field: %w","messagePattern":"write task_id field: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/cli/client.go","lineNumber":505,"sourceCode":"\n// UploadChatAttachment uploads a file via multipart form to /api/upload-file\n// tagged with a chat task (task_id). The server binds the row to the assistant\n// reply that task produces on completion. Returns the full AttachmentResponse\n// (id + markdown_url) so the agent can embed the image inline in its reply.\nfunc (c *APIClient) UploadChatAttachment(ctx context.Context, fileData []byte, filename, taskID string) (AttachmentResponse, error) {\n\tvar body bytes.Buffer\n\twriter := multipart.NewWriter(&body)\n\n\tpart, err := writer.CreateFormFile(\"file\", filepath.Base(filename))\n\tif err != nil {\n\t\treturn AttachmentResponse{}, fmt.Errorf(\"create form file: %w\", err)\n\t}\n\tif _, err := part.Write(fileData); err != nil {\n\t\treturn AttachmentResponse{}, fmt.Errorf(\"write file data: %w\", err)\n\t}\n\tif taskID != \"\" {\n\t\tif err := writer.WriteField(\"task_id\", taskID); err != nil {\n\t\t\treturn AttachmentResponse{}, fmt.Errorf(\"write task_id field: %w\", err)\n\t\t}\n\t}\n\tif err := writer.Close(); err != nil {\n\t\treturn AttachmentResponse{}, fmt.Errorf(\"close multipart writer: %w\", err)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.BaseURL+\"/api/upload-file\", &body)\n\tif err != nil {\n\t\treturn AttachmentResponse{}, err\n\t}\n\treq.Header.Set(\"Content-Type\", writer.FormDataContentType())\n\tc.setHeaders(req)\n\n\t// Honor a longer context deadline for large images, same as UploadFileWithURL.\n\thttpClient := c.HTTPClient\n\tif deadline, ok := ctx.Deadline(); ok {\n\t\tremaining := time.Until(deadline)\n\t\tif remaining > httpClient.Timeout {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/cli/client.go#L487-L523","documentation":"Error \"write task_id field: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/cli/client.go:505 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the upload; the multipart request could not be completed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}