{"record":{"id":"e6b84fc37787cdb9","repo":"zeroclaw-labs/zeroclaw","slug":"failed-to-start-ai-conversation","errorCode":null,"errorMessage":"Failed to start AI conversation: {}","messagePattern":"Failed to start AI conversation: (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/clawdtalk.rs","lineNumber":192,"sourceCode":"            },\n        };\n\n        let response = self\n            .client\n            .post(format!(\n                \"{}/calls/{}/actions/ai_conversation\",\n                Self::TELNYX_API_URL,\n                call_control_id\n            ))\n            .header(\"Authorization\", format!(\"Bearer {}\", self.api_key))\n            .header(\"Content-Type\", \"application/json\")\n            .json(&request)\n            .send()\n            .await?;\n\n        if !response.status().is_success() {\n            let error = response.text().await?;\n            anyhow::bail!(\"Failed to start AI conversation: {}\", error);\n        }\n\n        Ok(())\n    }\n}\n\n/// Active call session\n#[derive(Debug, Clone)]\npub struct CallSession {\n    pub call_control_id: String,\n    pub call_leg_id: String,\n    pub call_session_id: String,\n}\n\n/// Telnyx call initiation request\n#[derive(Debug, Serialize)]\nstruct CallRequest {\n    connection_id: String,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/clawdtalk.rs#L174-L210","documentation":"start_ai_conversation POSTs system_prompt and model to Telnyx /v2/calls/{call_control_id}/actions/ai_conversation (voice \"alloy\", speed 1.0). Non-2xx embeds Telnyx's error body. It fails for stale or unknown call ids, model identifiers Telnyx does not support for AI conversations, or connections/accounts where the AI conversation feature is not enabled.","triggerScenarios":"Invoking it on a leg that already ended (same timing hazard as speak — it must run on an answered call); model string not valid for Telnyx AI conversations; connection_id bound to a Call Control application without AI enabled; api_key lacking the AI scope; prompt exceeding Telnyx limits.","commonSituations":"Model names copied from OpenAI docs that Telnyx does not expose; sandbox accounts without AI minutes; invoking after voicemail detection ended the leg.","solutions":["Read the embedded Telnyx body — it distinguishes unknown call (404) from invalid model (422)","Run it immediately on an answered leg (after call.answered), never after a fixed delay on an unverified leg","Use a model identifier from Telnyx's AI conversation docs for your account tier","Verify the Call Control application behind connection_id has AI conversation enabled"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = channel.start_ai_conversation(&session.call_control_id, prompt, model).await {\n    // inspect the embedded Telnyx body: unknown call vs invalid model vs feature-disabled\n    let _ = channel.hangup(&session.call_control_id).await;\n}","preventionTips":["Start AI conversations only on answered legs","Pin model identifiers from Telnyx docs and test them per environment","Verify the Call Control application has AI conversations enabled before shipping"],"tags":["clawdtalk","telnyx","ai-voice","call-control"],"backgroundTag":"telnyx-api-error","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}