{"record":{"id":"a1ced917601951a4","repo":"zeroclaw-labs/zeroclaw","slug":"unknown-action-action-valid-get-set-disabl","errorCode":null,"errorMessage":"Unknown action '{action}'. Valid: get, set, disable, list_services, apply_env, clear_env","messagePattern":"Unknown action '(.+?)'\\. Valid: get, set, disable, list_services, apply_env, clear_env","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-tools/src/proxy_config.rs","lineNumber":505,"sourceCode":"            .to_ascii_lowercase();\n\n        let result = match action.as_str() {\n            \"get\" => self.handle_get(),\n            \"list_services\" => self.handle_list_services(),\n            \"set\" | \"disable\" | \"apply_env\" | \"clear_env\" => {\n                if let Some(blocked) = self.require_write_access() {\n                    return Ok(blocked);\n                }\n\n                match action.as_str() {\n                    \"set\" => Box::pin(self.handle_set(&args)).await,\n                    \"disable\" => Box::pin(self.handle_disable(&args)).await,\n                    \"apply_env\" => self.handle_apply_env(),\n                    \"clear_env\" => self.handle_clear_env(),\n                    _ => unreachable!(\"handled above\"),\n                }\n            }\n            _ => anyhow::bail!(\n                \"Unknown action '{action}'. Valid: get, set, disable, list_services, apply_env, clear_env\"\n            ),\n        };\n\n        match result {\n            Ok(outcome) => Ok(outcome),\n            Err(error) => Ok(ToolResult {\n                success: false,\n                output: ToolOutput::default(),\n                error: Some(error.to_string()),\n            }),\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/proxy_config.rs#L487-L523","documentation":"proxy_config's execute dispatches on the string in the `action` field; after the known branches (get, set, disable, list_services, apply_env, clear_env) run, any other action string falls to this bail listing the valid names. It is a strict, case-sensitive snake_case match.","triggerScenarios":"Typos and casing variants such as \"getList\", \"apply-env\", \"services\", \"enable\", or \"set_env\"; also programmatic callers building the action string dynamically with a wrong constant.","commonSituations":"LLM-driven tool invocation inventing plausible action names; scripts written against an older/newer version of the tool where the action set differs; copy-paste from docs of a different tool (e.g. jira or cloud_patterns actions).","solutions":["Use exactly one of: get, set, disable, list_services, apply_env, clear_env (lowercase, underscores)","Print the tool's parameter schema (description lists valid actions) when unsure","Guard dynamic callers with an allowlist constant so invalid names fail at compile time, not at runtime"],"exampleFix":"// before\n{\"action\":\"apply-env\"}\n// after\n{\"action\":\"apply_env\"}","handlingStrategy":"validation","validationCode":"const PROXY_ACTIONS: &[&str] = &[\"get\",\"set\",\"disable\",\"list_services\",\"apply_env\",\"clear_env\"];\nif !PROXY_ACTIONS.contains(&action.as_str()) {\n    return Err(anyhow::anyhow!(\"invalid proxy action {action}\"));\n}","typeGuard":"fn is_known_proxy_action(a: &str) -> bool {\n    [\"get\",\"set\",\"disable\",\"list_services\",\"apply_env\",\"clear_env\"].contains(&a)\n}","tryCatchPattern":"Err(e) if e.to_string().starts_with(\"Unknown action\") => {\n    // log the rejected action plus the valid list; fail the user request with both\n}","preventionTips":["Centralize action names in one constant shared by callers and tests","For LLM-driven calls, include the valid action list in the prompt/tool description","Reject unknown actions in your own layer first so logs stay clean"],"tags":["dispatch","action","typo","proxy","validation"],"backgroundTag":"unknown-action-parameter","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}