{"record":{"id":"7615a8b04e7287f3","repo":"Mintplex-Labs/anything-llm","slug":"workspace-id-is-required","errorCode":null,"errorMessage":"Workspace ID is required","messagePattern":"Workspace ID is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/mobile/utils/index.js","lineNumber":148,"sourceCode":"    return response.status(200).json({ success: true });\n  }\n\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;","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/endpoints/mobile/utils/index.js#L130-L166","documentation":"Input validation in handleMobileCommand() for the 'stream-chat' command: the request body omits workspaceSlug, so no workspace can be resolved to stream a chat into. The endpoint returns HTTP 400 with this message instead of proceeding.","triggerScenarios":"Thrown at server/endpoints/mobile/utils/index.js:144 when the library encounters an invalid state.","commonSituations":"A mobile API call was made without the required workspace ID.","solutions":["Include the workspace ID in the request payload.","Fetch the workspace list to obtain a valid ID."],"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-14T05:17:10.506Z"}