zeroclaw-labs/zeroclaw · error · anyhow::Error
Unknown action '{action}'. Valid: get, set, disable, list_se
Error message
Unknown action '{action}'. Valid: get, set, disable, list_services, apply_env, clear_env What it means
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.
Source
Thrown at crates/zeroclaw-tools/src/proxy_config.rs:505
.to_ascii_lowercase();
let result = match action.as_str() {
"get" => self.handle_get(),
"list_services" => self.handle_list_services(),
"set" | "disable" | "apply_env" | "clear_env" => {
if let Some(blocked) = self.require_write_access() {
return Ok(blocked);
}
match action.as_str() {
"set" => Box::pin(self.handle_set(&args)).await,
"disable" => Box::pin(self.handle_disable(&args)).await,
"apply_env" => self.handle_apply_env(),
"clear_env" => self.handle_clear_env(),
_ => unreachable!("handled above"),
}
}
_ => anyhow::bail!(
"Unknown action '{action}'. Valid: get, set, disable, list_services, apply_env, clear_env"
),
};
match result {
Ok(outcome) => Ok(outcome),
Err(error) => Ok(ToolResult {
success: false,
output: ToolOutput::default(),
error: Some(error.to_string()),
}),
}
}
}
#[cfg(test)]
mod tests {
use super::*;View on GitHub (pinned to 88bb9c8533)
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
Example fix
// before
{"action":"apply-env"}
// after
{"action":"apply_env"} Defensive patterns
Strategy: validation
Validate before calling
const PROXY_ACTIONS: &[&str] = &["get","set","disable","list_services","apply_env","clear_env"];
if !PROXY_ACTIONS.contains(&action.as_str()) {
return Err(anyhow::anyhow!("invalid proxy action {action}"));
} Type guard
fn is_known_proxy_action(a: &str) -> bool {
["get","set","disable","list_services","apply_env","clear_env"].contains(&a)
} Try / catch
Err(e) if e.to_string().starts_with("Unknown action") => {
// log the rejected action plus the valid list; fail the user request with both
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- unsupported delivery channel: {other}
- Unsupported proxy service selector '{selector}'. Use tool `p
- Proxy is enabled but no proxy URL is configured. Set at leas
- proxy.scope='services' requires a non-empty proxy.services l
- Unsupported browser action: {other}
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/a1ced917601951a4.
Report an issue: GitHub.