{"record":{"id":"22006814a1ec19dc","repo":"warpdotdev/warp","slug":"a-runner-uid-or-name-is-required","errorCode":null,"errorMessage":"A runner UID or --name is required","messagePattern":"A runner UID or --name is required","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/runner.rs","lineNumber":237,"sourceCode":"        .with_default(false)\n        .prompt()\n        .unwrap_or_default())\n}\n\n/// Resolve a runner by UID or (unambiguous) name from a fetched list.\nfn resolve_runner<'a>(\n    runners: &'a [Runner],\n    id: Option<&str>,\n    name: Option<&str>,\n) -> Result<&'a Runner> {\n    if let Some(id) = id {\n        return runners\n            .iter()\n            .find(|runner| runner.uid.inner() == id)\n            .ok_or_else(|| anyhow!(\"Runner '{id}' not found\"));\n    }\n\n    let name = name.ok_or_else(|| anyhow!(\"A runner UID or --name is required\"))?;\n    let matches: Vec<&Runner> = runners\n        .iter()\n        .filter(|runner| runner.config.name == name)\n        .collect();\n    match matches.as_slice() {\n        [] => Err(anyhow!(\"Runner '{name}' not found\")),\n        [runner] => Ok(runner),\n        _ => Err(anyhow!(\n            \"Multiple runners match '{name}'; specify the runner by UID\"\n        )),\n    }\n}\n\n/// Build the [`RunnerInput`] for a create operation.\nfn build_create_input(args: CreateRunnerArgs, owner: GqlOwner) -> UpsertRunnerInput {\n    let os = os_to_gql(args.os);\n    let (linux, mac) = match args.os {\n        RunnerOsArg::Linux => (","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/runner.rs#L219-L255","documentation":"Runner resolution requires exactly one selector — a UID (positional/--id) or a --name. Neither was provided, so there is nothing to match against the fetched runner list and the command fails before any server mutation.","triggerScenarios":"Invoking a runner subcommand that routes through resolve_runner with both id and name None — flags omitted on the command line or empty variables expanding to nothing.","commonSituations":"Assuming the command defaults to a 'current' runner; shell scripts where the UID variable is unset (`warp runner delete $RUNNER_ID` with RUNNER_ID empty); wrappers dropping the flag.","solutions":["Pass a runner UID: `warp runner delete <uid>`","Or pass --name <name> when the name is unique (ambiguous names error with 'Multiple runners match')","In scripts, fail early when the UID variable is empty rather than letting the CLI reject it"],"exampleFix":"# before\nwarp runner delete \"$RUNNER_ID\"   # RUNNER_ID unset -> expands to nothing\n\n# after\n: \"${RUNNER_ID:?RUNNER_ID must be set}\"\nwarp runner delete \"$RUNNER_ID\"","handlingStrategy":"validation","validationCode":"# Require a selector before invoking the CLI\n: \"${RUNNER_ID:?set RUNNER_ID or pass --name}\"\nwarp runner delete \"$RUNNER_ID\"","typeGuard":null,"tryCatchPattern":"out=$(warp runner delete 2>&1) || { case \"$out\" in *'UID or --name is required'*) echo 'usage: warp runner delete <uid> | --name <name>' >&2; exit 2;; *) echo \"$out\" >&2; exit 1;; esac; }","preventionTips":["Guard empty variables with : \"${VAR:?msg}\" in scripts","Pass exactly one selector — UID preferred, since names can collide"],"tags":["runner","arguments","cli"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}