{"record":{"id":"9b3a9a2a3f9c07dc","repo":"Hmbown/CodeWhale","slug":"workflow-tool-accepts-only-action-run","errorCode":null,"errorMessage":"workflow-tool accepts only action=run","messagePattern":"workflow-tool accepts only action=run","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":10623,"sourceCode":"    args: WorkflowToolArgs,\n    plugin_registry: std::sync::Arc<crate::plugins::PluginRegistry>,\n) -> Result<()> {\n    use crate::tools::spec::ToolSpec;\n\n    if args.approval_source != \"explicit-workflow-command\" {\n        bail!(\"workflow-tool requires --approval-source explicit-workflow-command\");\n    }\n    let input: serde_json::Value = serde_json::from_str(&args.input_json)\n        .context(\"--input-json must be a valid Workflow tool input object\")?;\n    if !input.is_object() {\n        bail!(\"--input-json must be a JSON object\");\n    }\n    if !input\n        .get(\"action\")\n        .and_then(serde_json::Value::as_str)\n        .is_some_and(|action| action.eq_ignore_ascii_case(\"run\"))\n    {\n        bail!(\"workflow-tool accepts only action=run\");\n    }\n\n    let workspace = resolve_workspace(cli);\n    let mut config = load_config_from_cli(cli)?;\n    merge_user_workspace_config(&mut config, cli.config.clone(), &workspace);\n    if let Ok(env_url) =\n        std::env::var(\"CODEWHALE_BASE_URL\").or_else(|_| std::env::var(\"DEEPSEEK_BASE_URL\"))\n    {\n        let trimmed = env_url.trim();\n        if !trimmed.is_empty() {\n            config.base_url = Some(trimmed.to_string());\n        }\n    }\n\n    let model = resolve_exec_model(&config, None);\n    let route = resolve_cli_exec_route(\n        &config,\n        &model,","sourceCodeStart":10605,"sourceCodeEnd":10641,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L10605-L10641","documentation":"workflow-tool executes only the run action: after the object shape check, the input's action field must be the string 'run' (case-insensitive). A missing action key or any other action name is refused before any workflow starts.","triggerScenarios":"Passing {\"action\":\"status\"} or {\"action\":\"cancel\"}; omitting the action field entirely; a model hallucinating action names from a different tool's API.","commonSituations":"Reusing request shapes from other tool surfaces; stale examples; case variants like 'Run' (accepted) vs 'running' (rejected).","solutions":["Set action to \"run\" plus the fields the run action requires","Use the dedicated workflow commands for status/cancel-style operations","Validate the action key exists and equals run before invoking"],"exampleFix":"# before\n--input-json '{\"action\":\"status\",\"id\":7}'\n\n# after\n--input-json '{\"action\":\"run\",\"id\":7}'","handlingStrategy":"validation","validationCode":"jq -e '((.action // \"\") | ascii_downcase) == \"run\"' <<<\"$INPUT_JSON\" >/dev/null || { echo 'action must be \"run\"'; exit 1; }","typeGuard":"const isRunAction = (v) =>\n  typeof v?.action === 'string' && v.action.toLowerCase() === 'run';","tryCatchPattern":null,"preventionTips":["Validate the action key exists and equals run before calling workflow-tool","Use the dedicated workflow commands for non-run operations"],"tags":["workflow","action","validation","argument-validation"],"backgroundTag":"unsupported-action","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}