{"record":{"id":"b0921f0dd0311d5d","repo":"paperclipai/paperclip","slug":"adapterconfig-must-be-an-object","errorCode":null,"errorMessage":"adapterConfig must be an object","messagePattern":"adapterConfig must be an object","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":4029,"sourceCode":"        const statusEligible =\n          row.status !== \"paused\" &&\n          row.status !== \"terminated\" &&\n          row.status !== \"pending_approval\";\n\n        return {\n          id: row.id,\n          companyId: row.companyId,\n          companyName: row.companyName,\n          companyIssuePrefix: row.companyIssuePrefix,\n          agentName: row.agentName,\n          agentUrlKey: deriveAgentUrlKey(row.agentName, row.id),\n          role: row.role as InstanceSchedulerHeartbeatAgent[\"role\"],\n          title: row.title,\n          status: row.status as InstanceSchedulerHeartbeatAgent[\"status\"],\n          adapterType: row.adapterType,\n          intervalSec: policy.intervalSec,\n          heartbeatEnabled: policy.enabled,\n          schedulerActive: statusEligible && policy.enabled && policy.intervalSec > 0,\n          lastHeartbeatAt: row.lastHeartbeatAt,\n        };\n      })\n      .filter((item) =>\n        item.status !== \"paused\" &&\n        item.status !== \"terminated\" &&\n        item.status !== \"pending_approval\",\n      )\n      .sort((left, right) => {\n        if (left.schedulerActive !== right.schedulerActive) {\n          return left.schedulerActive ? -1 : 1;\n        }\n        const companyOrder = left.companyName.localeCompare(right.companyName);\n        if (companyOrder !== 0) return companyOrder;\n        return left.agentName.localeCompare(right.agentName);\n      });\n\n    res.json(items);","sourceCodeStart":4011,"sourceCodeEnd":4047,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/routes/agents.ts#L4011-L4047","documentation":"Shape guard on PATCH /agents/:id: the request supplies an 'adapterConfig' that is not a plain object (null, array, or scalar). Adapter config must be a map of option keys to values, so the update aborts with 400 before merging.","triggerScenarios":"Thrown at server/src/routes/agents.ts:3769 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send adapterConfig as a JSON object in the request body."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}