aaif-goose/goose · error

Invalid parameter format: '{}'. Expected format: key=value

Error message

Invalid parameter format: '{}'. Expected format: key=value

What it means

Deeplink parameters are parsed by splitting each CLI argument at the first '=' (splitn(2, '=')). An argument containing no '=' cannot form a key/value pair and is rejected immediately with this message before any recipe is loaded.

Source

Thrown at crates/goose-cli/src/commands/recipe.rs:158

                            println!("    Title: {}", title);
                        }
                        println!("    Path: {}", recipe.path);
                    } else {
                        println!("{}", output);
                    }
                }
            }
        }
    }
    Ok(())
}

fn parse_params(params: &[String]) -> Result<HashMap<String, String>> {
    let mut params_map = HashMap::new();
    for param in params {
        let parts: Vec<&str> = param.splitn(2, '=').collect();
        if parts.len() != 2 {
            return Err(anyhow::anyhow!(
                "Invalid parameter format: '{}'. Expected format: key=value",
                param
            ));
        }
        params_map.insert(parts[0].to_string(), parts[1].to_string());
    }
    Ok(params_map)
}

fn generate_deeplink(
    recipe_name: &str,
    params: HashMap<String, String>,
) -> Result<(String, goose::recipe::Recipe)> {
    let recipe_file = load_recipe_file(recipe_name)?;
    // Load the recipe file first to validate it
    let recipe = validate_recipe_template_from_file(&recipe_file)?;
    match recipe_deeplink::encode(&recipe) {
        Ok(encoded) => {

View on GitHub (pinned to 3810898a74)

Solutions

  1. Pass every parameter as key=value
  2. Quote the whole pair as one shell word: "model=gpt-4o"
  3. Remember values may themselves contain '=' (only the first '=' splits) — only the key side is constrained

Example fix

# before
goose recipe deeplink code-reviewer verbose

# after
goose recipe deeplink code-reviewer verbose=true
Defensive patterns

Strategy: validation

Validate before calling

# Reject malformed params before calling goose
for p in "$@"; do
  [[ "$p" == *=* ]] || { echo "param '$p' must be key=value" >&2; exit 2; }
done

Type guard

fn is_key_value(s: &str) -> bool {
    match s.split_once('=') {
        Some((key, _)) => !key.is_empty(),
        None => false,
    }
}

Prevention

When it happens

Trigger: Passing a bare token to a recipe deeplink/open command, e.g. `goose recipe deeplink myrecipe verbose` instead of `verbose=true`; shell quoting mistakes that detach the key from the value.

Common situations: Scripts interpolating unset variables so only the key reaches argv; copy-pasted commands missing the '=value' side; assuming space-separated flags work like other CLIs.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/b1d703326acbc272. Report an issue: GitHub.