{"record":{"id":"38e14542d36ccc22","repo":"tinyhumansai/openhuman","slug":"composio-create-trigger-slug-must-not-be-empty","errorCode":null,"errorMessage":"composio.create_trigger: slug must not be empty","messagePattern":"composio\\.create_trigger: slug must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/client.rs","lineNumber":362,"sourceCode":"        let path = match connection_id.map(str::trim).filter(|id| !id.is_empty()) {\n            Some(id) => format!(\"/agent-integrations/composio/github/repos?connectionId={id}\"),\n            None => \"/agent-integrations/composio/github/repos\".to_string(),\n        };\n        tracing::debug!(path = %path, \"[composio] list_github_repos\");\n        self.inner.get::<ComposioGithubReposResponse>(&path).await\n    }\n\n    /// `POST /agent-integrations/composio/triggers` — create a trigger\n    /// instance for the authenticated user.\n    pub async fn create_trigger(\n        &self,\n        slug: &str,\n        connection_id: Option<&str>,\n        trigger_config: Option<serde_json::Value>,\n    ) -> Result<ComposioCreateTriggerResponse> {\n        let slug = slug.trim();\n        if slug.is_empty() {\n            anyhow::bail!(\"composio.create_trigger: slug must not be empty\");\n        }\n        let mut body = json!({ \"slug\": slug });\n        if let Some(connection_id) = connection_id.map(str::trim).filter(|id| !id.is_empty()) {\n            body[\"connectionId\"] = json!(connection_id);\n        }\n        if let Some(config) = trigger_config {\n            body[\"triggerConfig\"] = config;\n        }\n        tracing::debug!(slug = %slug, \"[composio] create_trigger\");\n        self.inner\n            .post::<ComposioCreateTriggerResponse>(\"/agent-integrations/composio/triggers\", &body)\n            .await\n    }\n\n    // ── Trigger management (PR #671) ────────────────────────────────\n\n    /// `GET /agent-integrations/composio/triggers/available` — catalog of\n    /// triggers the user could enable for a toolkit. For GitHub the","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/client.rs#L344-L380","documentation":"ComposioClient::create_trigger rejects a trigger slug that is empty after trimming, before POST /agent-integrations/composio/triggers is built. The slug identifies the trigger type; blank input is a caller bug the client refuses to forward.","triggerScenarios":"Calling create_trigger(\"\", connection_id, trigger_config) or with a whitespace-only slug — usually a UI flow where the trigger template was not yet selected, or an automation config whose trigger key is missing.","commonSituations":"Trigger-creation form submitted with no template chosen; trigger slug read from a renamed config key; flows/automations engine instantiating a trigger from an incompletely-defined node.","solutions":["Require trigger template selection before the create action is enabled","Validate slug non-empty (and ideally against list_available_triggers output) at the RPC/config boundary","Log the originating flow/automation when this fires to find which producer omits the slug"],"exampleFix":"// before\nclient.create_trigger(&node.slug, conn_id, cfg).await?;\n\n// after\nlet slug = node.slug.trim();\nif slug.is_empty() {\n    anyhow::bail!(\"trigger node {} has no slug; fix the automation definition\", node.id);\n}\nclient.create_trigger(slug, conn_id, cfg).await?;","handlingStrategy":"validation","validationCode":"let slug = slug.trim();\nif slug.is_empty() {\n    anyhow::bail!(\"trigger slug is required to create a trigger\");\n}\nclient.create_trigger(slug, connection_id, trigger_config).await?;","typeGuard":"fn is_non_empty_slug(s: &str) -> bool {\n    !s.trim().is_empty()\n}","tryCatchPattern":null,"preventionTips":["Require trigger-template selection before create is reachable in the flow","Validate automation/flow definitions at load time: every trigger node must carry a slug","Validate slugs against the available-triggers catalog to reject unknown values early"],"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"}