{"record":{"id":"049a9ccd281d0bc3","repo":"Mintplex-Labs/anything-llm","slug":"message-is-required","errorCode":null,"errorMessage":"Message is required","messagePattern":"Message is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/mobile/utils/index.js","lineNumber":150,"sourceCode":"\n  if (command === \"new-thread\") {\n    const { workspaceSlug } = body;\n    const workspace = user\n      ? await Workspace.getWithUser(user, { slug: String(workspaceSlug) })\n      : await Workspace.get({ slug: String(workspaceSlug) });\n\n    if (!workspace)\n      return response.status(400).json({ error: \"Workspace not found\" });\n    const { thread } = await WorkspaceThread.new(workspace, user?.id);\n    return response.status(200).json({ thread });\n  }\n\n  if (command === \"stream-chat\") {\n    const { workspaceSlug = null, threadSlug = null, message } = body;\n    if (!workspaceSlug)\n      return response.status(400).json({ error: \"Workspace ID is required\" });\n    else if (!message)\n      return response.status(400).json({ error: \"Message is required\" });\n\n    const workspace = user\n      ? await Workspace.getWithUser(user, { slug: String(workspaceSlug) })\n      : await Workspace.get({ slug: String(workspaceSlug) });\n\n    if (!workspace)\n      return response.status(400).json({ error: \"Workspace not found\" });\n    const thread = threadSlug\n      ? await prisma.workspace_threads.findFirst({\n          where: {\n            workspace_id: workspace.id,\n            slug: String(threadSlug),\n            ...(user ? { user_id: user.id } : {}),\n          },\n        })\n      : null;\n\n    response.setHeader(\"Cache-Control\", \"no-cache\");","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/endpoints/mobile/utils/index.js#L132-L168","documentation":"Validation guard in the mobile stream-chat command handler: the command payload lacks a message field, so there is no user prompt to stream a chat response for and the command is rejected with the required-field error.","triggerScenarios":"Thrown at server/endpoints/mobile/utils/index.js:146 when the library encounters an invalid state.","commonSituations":"Sending a chat/command request from mobile without a message body.","solutions":["Include a non-empty message in the request.","Check the client is serializing the message body correctly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}