Hmbown/CodeWhale · error

workflow-tool accepts only action=run

Error message

workflow-tool accepts only action=run

What it means

The workflow tool entry point only supports a single action, "run". If the tool input JSON does not carry action="run" (compared case-insensitively), the handler bails out before resolving the workspace or loading config, because any other action is not a recognized workflow operation.

Solutions

  1. Set the tool input to {"action": "run", ...} exactly, with action as a JSON string
  2. Remove any wrapper whitespace/newlines around the action value
  3. If another action was intended, check whether the workflow tool exposes it at all — it does not; only run exists
  4. Validate the JSON payload before dispatch to confirm action is a string equal to run

Example fix

// before
{"action": "execute", "workflow": "deploy"}
// after
{"action": "run", "workflow": "deploy"}
Defensive patterns

Strategy: validation

Validate before calling

const input = JSON.parse(toolCall.arguments);
if (typeof input.action !== "string" || input.action.toLowerCase() !== "run") {
  throw new Error(`workflow-tool requires action="run", got ${JSON.stringify(input.action)}`);
}

Type guard

const isRunAction = (v: unknown): v is { action: string } & Record<string, unknown> =>
  typeof v === "object" && v !== null &&
  typeof (v as any).action === "string" &&
  (v as any).action.toLowerCase() === "run";

Prevention

When it happens

Trigger: Calling the workflow tool with input missing the "action" key, with action set to a value other than "run" (e.g. "list", "status", "RUN " with stray whitespace will still pass due to eq_ignore_ascii_case, but "Run workflow" will not), or with action as a non-string JSON value (number, object).

Common situations: Hand-written tool-call JSON from an agent guessing an action name; a wrapper or script automating workflow invocations with a stale or invented action verb; JSON serialization producing a non-string action field.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/9b3a9a2a3f9c07dc. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/lib.rs:12236

    args: WorkflowToolArgs,
    plugin_registry: std::sync::Arc<crate::plugins::PluginRegistry>,
) -> Result<()> {
    use crate::tools::spec::ToolSpec;

    if args.approval_source != "explicit-workflow-command" {
        bail!("workflow-tool requires --approval-source explicit-workflow-command");
    }
    let input: serde_json::Value = serde_json::from_str(&args.input_json)
        .context("--input-json must be a valid Workflow tool input object")?;
    if !input.is_object() {
        bail!("--input-json must be a JSON object");
    }
    if !input
        .get("action")
        .and_then(serde_json::Value::as_str)
        .is_some_and(|action| action.eq_ignore_ascii_case("run"))
    {
        bail!("workflow-tool accepts only action=run");
    }

    let workspace = resolve_workspace(cli);
    let mut config = load_config_from_cli(cli)?;
    merge_user_workspace_config(&mut config, cli.config.clone(), &workspace);
    if let Ok(env_url) =
        std::env::var("CODEWHALE_BASE_URL").or_else(|_| std::env::var("DEEPSEEK_BASE_URL"))
    {
        let trimmed = env_url.trim();
        if !trimmed.is_empty() {
            config.base_url = Some(trimmed.to_string());
        }
    }

    initialize_cloud_facts(&config);
    let model = resolve_exec_model(&config, None);
    let route = resolve_cli_exec_route(
        &config,

View on GitHub (pinned to 73e0f67d83)