nikivdev/code · warning
Suggested command is incomplete.
Error message
Suggested command is incomplete.
What it means
Flow lets the user accept an AI-suggested command and re-executes it through the current binary. If, after mapping the 'f'/'flow' alias to the executable, the token list is empty, there is literally nothing to run, so execute_suggested_command bails with this message instead of spawning an empty process.
Source
Thrown at src/ask.rs:259
}
fn execute_suggested_command(command: &str) -> Result<()> {
let tokens = shell_words::split(command).unwrap_or_else(|_| {
command
.split_whitespace()
.map(|part| part.to_string())
.collect()
});
if tokens.is_empty() {
bail!("Suggested command is empty.");
}
let args = match tokens.first().map(|token| token.as_str()) {
Some("f") | Some("flow") => tokens[1..].to_vec(),
_ => tokens,
};
if args.is_empty() {
bail!("Suggested command is incomplete.");
}
let exe = std::env::current_exe()?;
let status = Command::new(&exe)
.args(&args)
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.status()
.with_context(|| format!("failed to execute suggested command via {}", exe.display()))?;
if !status.success() {
bail!(
"suggested command exited unsuccessfully with status {}",
status
);
}
Ok(())
}View on GitHub (pinned to a747e741ae)
Solutions
- Check the accepted suggestion before executing: reject or re-ask when it has no subcommand after the 'f'/'flow' prefix
- Improve the AI prompt to always emit 'f <subcommand> [args]' and validate the suggestion before offering it to the user
- Have the fallback path print help (e.g. run the binary with '--help') instead of erroring on an empty command
Example fix
// before
if args.is_empty() {
bail!("Suggested command is incomplete.");
}
// after
if args.is_empty() {
eprintln!("Suggestion had no subcommand; showing help instead.");
let status = Command::new(&exe).arg("--help").status()?;
return Ok(());
} Defensive patterns
Strategy: validation
Validate before calling
fn is_executable_suggestion(tokens: &[String]) -> bool {
match tokens.first().map(|s| s.as_str()) {
Some("f") | Some("flow") => tokens.len() > 1,
Some(_) => !tokens.is_empty(),
None => false,
}
}
// call before executing: if !is_executable_suggestion(&tokens) { re-prompt } Try / catch
match maybe_offer_execute(...) {
Err(e) if e.to_string().contains("incomplete") => println!("Suggestion had no command; nothing to run."),
other => other?,
} Prevention
- Validate suggestions contain a subcommand before offering them to the user
- Prompt the AI to always emit 'f <subcommand> [args]'
- Trim and tokenize the suggestion in the UI layer before acceptance
- Show help as a fallback instead of failing
When it happens
Trigger: The user accepts a suggested command that consists only of the bare 'f' or 'flow' token (or an empty suggestion), so tokens[1..] is empty after the alias strip and args.is_empty() is true.
Common situations: The AI model responds with just 'f' or 'flow' with no subcommand; a UI/clipboard flow truncated the suggestion; a suggestion string with only whitespace was accepted.
Related errors
- Command '{}' is incomplete.
- Relative path cannot be empty.
- Relative path must not be absolute.
- plan body is empty
- no queries provided
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/dc79562b73dca0f9.
Report an issue: GitHub.