{"record":{"id":"4da79cb2627a11d3","repo":"warpdotdev/warp","slug":"invalid-runtime-state-please-file-a-bug-report","errorCode":null,"errorMessage":"Invalid runtime state - please file a bug report.","messagePattern":"Invalid runtime state - please file a bug report\\.","errorType":"exception","errorClass":"AgentDriverError","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/mod.rs","lineNumber":458,"sourceCode":"        .filter(|_| args.harness == Harness::Oz)\n        .map(|model_id| common::validate_agent_mode_base_model_id(model_id, ctx))\n        .transpose()?;\n\n    // Keep the task config snapshot aligned with the effective model selection.\n    merged_config.model_id = model_override.clone().map(|id| id.to_string());\n\n    // Combine base_prompt with user prompt locally.\n    let local_prompt = match (merged_config.base_prompt.as_deref(), prompt) {\n        (Some(base_prompt), Some(Prompt::PlainText(user_prompt))) => {\n            Prompt::PlainText(format!(\"{base_prompt}\\n\\n{user_prompt}\"))\n        }\n        (Some(base_prompt), None) => {\n            // Skill-only invocation: use skill instructions as the prompt\n            Prompt::PlainText(base_prompt.to_string())\n        }\n        (_, Some(p)) => p.clone(),\n        (None, None) => {\n            return Err(anyhow::anyhow!(AgentDriverError::InvalidRuntimeState));\n        }\n    };\n\n    let task = Task {\n        prompt: AgentRunPrompt::Local(resolve_prompt(&local_prompt, ctx)?),\n        model: model_override,\n        profile: args.profile.clone(),\n        mcp_specs: runtime_mcp_specs,\n        harness: harness_kind(args.harness)?,\n    };\n\n    Ok((merged_config, task))\n}\n\n/// Build the task for server-side prompt resolution (task_id is set).\n/// Only CLI args contribute — no config file merge needed.\nfn build_server_side_task(\n    args: &RunAgentArgs,","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/mod.rs#L440-L476","documentation":"Internal invariant failure while assembling the Task to run: after config merge, neither a base prompt (skill instructions or config `base_prompt`) nor a user prompt exists, so the `(None, None)` match arm returns `AgentDriverError::InvalidRuntimeState`. The message asks for a bug report because a prompt or a skill is normally guaranteed by argument parsing. In practice it almost always means the invocation supplied neither.","triggerScenarios":"Invoking the agent run/task-create flow with no positional/stdin prompt AND no resolved skill AND no `base_prompt` in the merged config — typically from programmatic callers constructing RunAgentArgs by hand, a skill name that fails to resolve, or an empty-string prompt.","commonSituations":"Scripts piping an empty string as the prompt; a skill name typo so `resolved_skill` is None while the script also passes no prompt; SDK/harness code building args where the prompt field was forgotten.","solutions":["Pass a user prompt (positional argument or stdin) to `warp agent run`","Add `--skill <name>` so the skill instructions become the base prompt","If calling the SDK programmatically, assert that a prompt or base_prompt exists before building the Task","If both a prompt and a skill were provided and it still fires, follow the message and file a bug with the full command line"],"exampleFix":"# before\nwarp agent run --config ./agent.toml   # no prompt, no skill\n\n# after\nwarp agent run --config ./agent.toml --skill reviewer\n# or: warp agent run \"review my PR\"","handlingStrategy":"validation","validationCode":"// Before building the Task, require something to run\nlet has_prompt = prompt.as_ref().is_some_and(|p| !p.is_empty());\nlet has_base = merged_config.base_prompt.as_ref().is_some_and(|p| !p.is_empty());\nif !has_prompt && !has_base {\n    anyhow::bail!(\"nothing to run: pass a prompt or --skill\");\n}","typeGuard":null,"tryCatchPattern":"out=$(warp agent run --config \"$CONFIG\" 2>&1) || { case \"$out\" in *'Invalid runtime state'*) echo 'no prompt/skill given' >&2; exit 2;; *) echo \"$out\" >&2; exit 1;; esac; }","preventionTips":["Always pass either a positional prompt or --skill","Treat empty-string prompts as missing in wrappers and reject them early","Assert prompt.is_some() || base_prompt.is_some() in programmatic callers"],"tags":["agent-sdk","internal-error","validation","prompt"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}