{"record":{"id":"265514fa894e5fc1","repo":"nikivdev/code","slug":"no-prompt-provided-usage-f-agents-run-your-p","errorCode":null,"errorMessage":"No prompt provided.\nUsage: f agents run {} \"your prompt here\"","messagePattern":"No prompt provided\\.\nUsage: f agents run (.+?) \"your prompt here\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/agents.rs","lineNumber":874,"sourceCode":"\n/// Get the configured agent tool and model.\nfn get_agent_config() -> (String, Option<String>) {\n    if let Some(ts_config) = config::load_ts_config() {\n        if let Some(flow) = ts_config.flow {\n            if let Some(agents) = flow.agents {\n                let tool = agents.tool.unwrap_or_else(|| \"gen\".to_string());\n                return (tool, agents.model);\n            }\n        }\n    }\n    (\"gen\".to_string(), None)\n}\n\n/// Run an agent with a prompt.\nfn run_agent(agent: &str, prompt: Vec<String>) -> Result<()> {\n    let prompt_str = prompt.join(\" \");\n    if prompt_str.is_empty() {\n        bail!(\n            \"No prompt provided.\\nUsage: f agents run {} \\\"your prompt here\\\"\",\n            agent\n        );\n    }\n\n    // Build the full prompt based on agent type\n    let full_prompt = if agent == FLOW_AGENT_NAME {\n        build_flow_prompt(&prompt_str)?\n    } else {\n        // Regular subagent - use Task tool\n        format!(\n            \"Use the Task tool with subagent_type='{}' to: {}\",\n            agent, prompt_str\n        )\n    };\n\n    println!(\"Invoking {} agent...\\n\", agent);\n","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/agents.rs#L856-L892","documentation":"run_agent joins the prompt arguments into a single string and rejects an empty result, including usage text naming the agent. This is the canonical 'missing prompt' guard for `f agents run <agent>`; unlike error 11 it tells the caller exactly how to invoke the command.","triggerScenarios":"Invoking run_agent (directly, via run, run_fuzzy_agents, or run_agent_optional fallback) with an empty prompt vector, e.g. `f agents run claude` with no prompt words.","commonSituations":"Forgot the prompt argument; shell quoting swallowed the argument; a script passed an empty variable as the prompt.","solutions":["Provide the prompt as shown in the usage line: `f agents run <agent> \"your prompt here\"`.","Quote prompts with spaces/special characters.","Ensure the calling script substitutes a non-empty prompt variable.","If invoking programmatically, validate the prompt vec is non-empty before calling run_agent."],"exampleFix":"// before\nf agents run claude\n// error includes usage\n// after\nf agents run claude \"summarize the failing tests\"","handlingStrategy":"validation","validationCode":"[ $# -ge 1 ] && f agents run \"$1\" \"${@:2}\" || { echo 'Usage: f agents run <agent> \"prompt\"'; exit 2; }","typeGuard":"fn prompt_supplied(args: &[String]) -> bool {\n    !args.join(\" \").trim().is_empty()\n}","tryCatchPattern":"match run_agent(agent, prompt) {\n    Err(e) if e.to_string().contains(\"No prompt provided\") => {\n        eprintln!(\"Pass a prompt: f agents run {agent} \\\"...\\\"\");\n    }\n    other => other?,\n}","preventionTips":["Always include the prompt argument; quote strings with spaces.","Use the usage line printed in the error as the invocation template.","In scripts, fail fast on empty prompt variables (${PROMPT:?}).","Never rely on defaults — this command has no implicit prompt."],"tags":["agent","validation","cli","usage"],"backgroundTag":"missing-required-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}