{"record":{"id":"05e369bf55986cc1","repo":"diegosouzapw/OmniRoute","slug":"devin-send-message-failed-response-status-er","errorCode":null,"errorMessage":"Devin send message failed: ${response.status} ${error}","messagePattern":"Devin send message failed: (.+?) (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/cloudAgent/agents/devin.ts","lineNumber":121,"sourceCode":"  }\n\n  async sendMessage(\n    externalId: string,\n    message: string,\n    credentials: AgentCredentials\n  ): Promise<CloudAgentActivity> {\n    const response = await fetch(`${this.baseUrl}/sessions/${externalId}/message`, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        Authorization: `Bearer ${credentials.apiKey}`,\n      },\n      body: JSON.stringify({ content: message }),\n    });\n\n    if (!response.ok) {\n      const error = await response.text();\n      throw new Error(`Devin send message failed: ${response.status} ${error}`);\n    }\n\n    return {\n      id: this.generateActivityId(),\n      type: \"message\",\n      content: message,\n      timestamp: new Date().toISOString(),\n    };\n  }\n\n  async listSources(\n    _credentials: AgentCredentials\n  ): Promise<{ name: string; url: string; branch?: string }[]> {\n    return [];\n  }\n}\n","sourceCodeStart":103,"sourceCodeEnd":138,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/cloudAgent/agents/devin.ts#L103-L138","documentation":"Thrown in DevinCloudAgent.sendMessage when the POST to the Devin API session-message endpoint returns a non-2xx status. The status code and the upstream response body are embedded in the message, so the failure is an upstream API rejection (auth failure, invalid externalId/session, expired session, rate limit, or server error), not a local input error.","triggerScenarios":"Thrown at src/lib/cloudAgent/agents/devin.ts:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log response.status and the upstream body to determine whether the API key is valid and the session externalId exists","For 401/403, prompt the user to re-authenticate or update the Devin API key in credentials","For 404, verify the session externalId corresponds to an existing Devin session","For 429/5xx, surface a retryable failure and retry with backoff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}