{"record":{"id":"847c568216b6e611","repo":"paperclipai/paperclip","slug":"request-body-must-include-disabled-true-false","errorCode":null,"errorMessage":"Request body must include { \"disabled\": true|false }.","messagePattern":"Request body must include (.+?)\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/adapters.ts","lineNumber":458,"sourceCode":"    res.json(buildAdapterInfo(adapter, externalRecord, disabledSet));\n  });\n\n  /**\n   * PATCH /api/adapters/:type\n   *\n   * Enable or disable an adapter. Disabled adapters are hidden from agent\n   * creation menus but remain functional for existing agents.\n   *\n   * Request body: { \"disabled\": boolean }\n   */\n  router.patch(\"/adapters/:type\", async (req, res) => {\n    assertInstanceAdmin(req);\n\n    assertAdapterManagementVisible();\n\n    const adapterType = req.params.type;\n    const { disabled } = req.body as { disabled?: boolean };\n\n    if (typeof disabled !== \"boolean\") {\n      res.status(400).json({ error: \"Request body must include { \\\"disabled\\\": true|false }.\" });\n      return;\n    }\n\n    // Check that the adapter exists in the registry\n    const existing = findServerAdapter(adapterType);\n    if (!existing) {\n      res.status(404).json({ error: `Adapter \"${adapterType}\" is not registered.` });\n      return;\n    }\n\n    const changed = setAdapterDisabled(adapterType, disabled);\n\n    if (changed) {\n      logger.info({ type: adapterType, disabled }, \"Adapter enabled/disabled\");\n    }\n","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/routes/adapters.ts#L440-L476","documentation":"Body-shape guard on PATCH /api/adapters/:type: the enable/disable toggle requires a boolean 'disabled' field, but the body omits it or supplies a non-boolean, so the route returns 400 without mutating adapter state.","triggerScenarios":"Thrown at server/src/routes/adapters.ts:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a request body of the form {\"disabled\": true} or {\"disabled\": false}."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}