{"record":{"id":"92c8e2aef473f01c","repo":"paperclipai/paperclip","slug":"the-device-login-start-request-is-invalid","errorCode":null,"errorMessage":"The device login start request is invalid.","messagePattern":"The device login start request is invalid\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/adapter-login-route-spine.ts","lineNumber":95,"sourceCode":" * null when a step sends a response; the caller must then stop.\n */\nexport async function runAdapterLoginStartSpine<TData extends { environmentId: string }>(\n  input: AdapterLoginStartSpineInput<TData>,\n): Promise<AdapterLoginStartResolution<TData> | null> {\n  const ownerUserId = await input.deriveOwner();\n\n  if (input.guardBeforeValidate) {\n    await input.guardBeforeValidate();\n  }\n\n  const body =\n    input.req.body && typeof input.req.body === \"object\"\n      ? (input.req.body as Record<string, unknown>)\n      : {};\n  const candidate = input.requestOverrides ? { ...body, ...input.requestOverrides } : body;\n  const parsed = input.requestSchema.safeParse(candidate);\n  if (!parsed.success) {\n    input.res.status(400).json({ error: input.invalidRequestError });\n    return null;\n  }\n  const data = parsed.data;\n\n  if (input.guardAfterValidate) {\n    const stop = await input.guardAfterValidate(data);\n    if (stop) return null;\n  }\n\n  await input.assertSandbox(data);\n  return { ownerUserId, data };\n}\n","sourceCodeStart":77,"sourceCodeEnd":108,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/adapter-login-route-spine.ts#L77-L108","documentation":"The device login start spine rejected the request body: requestSchema validation failed on the start payload (e.g. missing/invalid environmentId or adapter fields); invalidRequestError is the configured generic message.","triggerScenarios":"Thrown at server/src/routes/adapter-login-route-spine.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the request body against the device login start schema","Ensure environmentId is present and valid","Remove unknown/incorrectly-typed fields and retry the start"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-21T17:58:32.592Z","contentChangedAt":"2026-08-21T17:58:32.592Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}