{"record":{"id":"58cf727b5b944563","repo":"multica-ai/multica","slug":"upload-response-missing-attachment-id","errorCode":null,"errorMessage":"upload response missing attachment id","messagePattern":"upload response missing attachment id","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/cli/client.go","lineNumber":483,"sourceCode":"\tresp, err := c.HTTPClient.Do(req)\n\terr = wrapTransport(req, err)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode >= 400 {\n\t\treturn \"\", newHTTPError(http.MethodPost, \"/api/upload-file\", resp)\n\t}\n\n\tvar result map[string]any\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\treturn \"\", fmt.Errorf(\"decode upload response: %w\", err)\n\t}\n\n\tid, _ := result[\"id\"].(string)\n\tif id == \"\" {\n\t\treturn \"\", fmt.Errorf(\"upload response missing attachment id\")\n\t}\n\treturn id, nil\n}\n\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)","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/cli/client.go#L465-L501","documentation":"Error \"upload response missing attachment id\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/cli/client.go:483 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the upload; if it persists, report the missing attachment id as a server bug."],"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"}