{"record":{"id":"073005a8716f6710","repo":"warpdotdev/warp","slug":"unexpected-argument-skill-found-073005","errorCode":null,"errorMessage":"unexpected argument '--skill' found","messagePattern":"unexpected argument '--skill' found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/mod.rs","lineNumber":277,"sourceCode":"\n/// Run the agent with the provided command.\nfn run_agent(\n    ctx: &mut AppContext,\n    global_options: GlobalOptions,\n    command: AgentCommand,\n) -> anyhow::Result<()> {\n    match command {\n        AgentCommand::Run(args) => {\n            if args.environment.is_some() && !FeatureFlag::CloudEnvironments.is_enabled() {\n                return Err(anyhow::anyhow!(\"unexpected argument '--environment' found\"));\n            }\n            if args.conversation.is_some() && !FeatureFlag::CloudConversations.is_enabled() {\n                return Err(anyhow::anyhow!(\n                    \"unexpected argument '--conversation' found\"\n                ));\n            }\n            if args.skill.is_some() && !FeatureFlag::OzPlatformSkills.is_enabled() {\n                return Err(anyhow::anyhow!(\"unexpected argument '--skill' found\"));\n            }\n            if args.harness != Harness::Oz && !FeatureFlag::AgentHarness.is_enabled() {\n                return Err(anyhow::anyhow!(\"unexpected argument '--harness' found\"));\n            }\n            if args.harness == Harness::OpenCode {\n                return Err(anyhow::anyhow!(\n                    \"The opencode harness is only supported for local child agent launches.\"\n                ));\n            }\n\n            let server_api = ServerApiProvider::handle(ctx).as_ref(ctx).get_ai_client();\n\n            // Start the agent driver runner, which will handle the rest of the setup steps\n            // (managing both sync and async steps) as well as triggering the driver.\n            let runner = ctx.add_singleton_model(|_| AgentDriverRunner);\n            runner.update(ctx, move |_, ctx| {\n                let spawner = ctx.spawner();\n                ctx.spawn(","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/mod.rs#L259-L295","documentation":"Thrown in run_agent for AgentCommand::Run (mod.rs:277): `--skill` parsed, but FeatureFlag::OzPlatformSkills is disabled, so the handler rejects it with clap-style 'unexpected argument' wording. The argument selects a platform skill for the run; when the flag is off the CLI pretends the option does not exist.","triggerScenarios":"Running `agent run --skill <name>` where FeatureFlag::OzPlatformSkills.is_enabled() == false. Skill resolution (and errors like format_skill_resolution_error) is never reached; the gate fires first.","commonSituations":"Invoking runs with a named skill on builds where platform skills are gated; skill bundles tested on dogfood then reused on release; stale scripts after the skills rollout changed channels.","solutions":["Drop `--skill` and spell the instructions out in the prompt","Use a build/account with OzPlatformSkills enabled, or update the CLI","As a Warp developer, override the flag or add FeatureFlag::OzPlatformSkills to DOGFOOD_FLAGS and rebuild"],"exampleFix":"# before\n$ oz agent run --skill code-review \"review PR 42\"\nError: unexpected argument '--skill' found\n\n# after\n$ oz agent run \"review PR 42 like the code-review skill would\"","handlingStrategy":"validation","validationCode":"if args.skill.is_some() {\n    anyhow::ensure!(\n        FeatureFlag::OzPlatformSkills.is_enabled(),\n        \"--skill requires OzPlatformSkills\"\n    );\n}","typeGuard":"pub fn can_use_skill_arg(args: &AgentRunArgs) -> bool {\n    args.skill.is_none() || FeatureFlag::OzPlatformSkills.is_enabled()\n}","tryCatchPattern":"match run_agent(ctx, opts, cmd) {\n    Err(e) if e.to_string().contains(\"unexpected argument '--skill'\") => {\n        // inline the skill instructions into the prompt instead\n    }\n    result => result?,\n}","preventionTips":["Design prompts so the skill flag is an enhancement, not a dependency","Check the flag before templating invocations","Remember skill-name resolution errors (ResolveSkillError) only occur after this gate passes"],"tags":["cli","feature-flags","skills","rust","clap"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}