{"record":{"id":"578c05560a696dcd","repo":"tinyhumansai/openhuman","slug":"composio-enable-trigger-slug-must-not-be-empty","errorCode":null,"errorMessage":"composio.enable_trigger: slug must not be empty","messagePattern":"composio\\.enable_trigger: slug must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/client.rs","lineNumber":440,"sourceCode":"            .get::<ComposioActiveTriggersResponse>(&path)\n            .await\n    }\n\n    /// `POST /agent-integrations/composio/triggers` — enable a single\n    /// trigger on a connection the caller owns.\n    pub async fn enable_trigger(\n        &self,\n        connection_id: &str,\n        slug: &str,\n        trigger_config: Option<serde_json::Value>,\n    ) -> Result<ComposioEnableTriggerResponse> {\n        let connection_id = connection_id.trim();\n        let slug = slug.trim();\n        if connection_id.is_empty() {\n            anyhow::bail!(\"composio.enable_trigger: connectionId must not be empty\");\n        }\n        if slug.is_empty() {\n            anyhow::bail!(\"composio.enable_trigger: slug must not be empty\");\n        }\n        let mut body = json!({ \"connectionId\": connection_id, \"slug\": slug });\n        if let Some(config) = trigger_config {\n            body[\"triggerConfig\"] = config;\n        }\n        tracing::debug!(slug = %slug, connection_id = %connection_id, \"[composio] enable_trigger\");\n        self.inner\n            .post::<ComposioEnableTriggerResponse>(\"/agent-integrations/composio/triggers\", &body)\n            .await\n    }\n\n    /// `DELETE /agent-integrations/composio/triggers/:triggerId`.\n    pub async fn disable_trigger(\n        &self,\n        trigger_id: &str,\n    ) -> Result<ComposioDisableTriggerResponse> {\n        let trigger_id = trigger_id.trim();\n        if trigger_id.is_empty() {","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/client.rs#L422-L458","documentation":"The second precondition of enable_trigger: the trigger slug must be non-empty after trimming before POST /agent-integrations/composio/triggers is built. It fires when the connection id is valid but the slug identifying the trigger type is blank.","triggerScenarios":"Calling enable_trigger(connection_id, \"\", trigger_config) — the enable action fired without a selected trigger template, or from a catalog row whose slug field failed to deserialize.","commonSituations":"Enable button enabled with no trigger row selected; catalog JSON shape changed so slug parses to nothing; automation definition referencing a trigger by an outdated key.","solutions":["Require a trigger row/template selection before the enable action is available","Validate the slug against list_available_triggers output to catch both blank and unknown slugs","If the slug comes from deserialized catalog data, fail at deserialization with row context"],"exampleFix":"// before\nclient.enable_trigger(conn_id, &row.slug, cfg).await?;\n\n// after\nlet slug = row.slug.trim();\nif slug.is_empty() {\n    anyhow::bail!(\"trigger row {} has no slug\", row.id);\n}\nclient.enable_trigger(conn_id, slug, cfg).await?;","handlingStrategy":"validation","validationCode":"let slug = slug.trim();\nif slug.is_empty() {\n    anyhow::bail!(\"a trigger slug is required to enable a trigger\");\n}\nclient.enable_trigger(connection_id, slug, trigger_config).await?;","typeGuard":"fn is_non_empty_slug(s: &str) -> bool {\n    !s.trim().is_empty()\n}","tryCatchPattern":null,"preventionTips":["Enable the action only after a trigger row is selected","Fail catalog deserialization loudly when a row lacks a slug, with row context","Validate slugs against list_available_triggers output to catch blanks and unknowns together"],"tags":["composio","triggers","validation","empty-string","argument-validation"],"backgroundTag":"empty-string-argument","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}