warpdotdev/warp · error

unexpected argument '--skill' found

Error message

unexpected argument '--skill' found

What it means

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.

Source

Thrown at app/src/ai/agent_sdk/mod.rs:277

/// Run the agent with the provided command.
fn run_agent(
    ctx: &mut AppContext,
    global_options: GlobalOptions,
    command: AgentCommand,
) -> anyhow::Result<()> {
    match command {
        AgentCommand::Run(args) => {
            if args.environment.is_some() && !FeatureFlag::CloudEnvironments.is_enabled() {
                return Err(anyhow::anyhow!("unexpected argument '--environment' found"));
            }
            if args.conversation.is_some() && !FeatureFlag::CloudConversations.is_enabled() {
                return Err(anyhow::anyhow!(
                    "unexpected argument '--conversation' found"
                ));
            }
            if args.skill.is_some() && !FeatureFlag::OzPlatformSkills.is_enabled() {
                return Err(anyhow::anyhow!("unexpected argument '--skill' found"));
            }
            if args.harness != Harness::Oz && !FeatureFlag::AgentHarness.is_enabled() {
                return Err(anyhow::anyhow!("unexpected argument '--harness' found"));
            }
            if args.harness == Harness::OpenCode {
                return Err(anyhow::anyhow!(
                    "The opencode harness is only supported for local child agent launches."
                ));
            }

            let server_api = ServerApiProvider::handle(ctx).as_ref(ctx).get_ai_client();

            // Start the agent driver runner, which will handle the rest of the setup steps
            // (managing both sync and async steps) as well as triggering the driver.
            let runner = ctx.add_singleton_model(|_| AgentDriverRunner);
            runner.update(ctx, move |_, ctx| {
                let spawner = ctx.spawner();
                ctx.spawn(

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Drop `--skill` and spell the instructions out in the prompt
  2. Use a build/account with OzPlatformSkills enabled, or update the CLI
  3. As a Warp developer, override the flag or add FeatureFlag::OzPlatformSkills to DOGFOOD_FLAGS and rebuild

Example fix

# before
$ oz agent run --skill code-review "review PR 42"
Error: unexpected argument '--skill' found

# after
$ oz agent run "review PR 42 like the code-review skill would"
Defensive patterns

Strategy: validation

Validate before calling

if args.skill.is_some() {
    anyhow::ensure!(
        FeatureFlag::OzPlatformSkills.is_enabled(),
        "--skill requires OzPlatformSkills"
    );
}

Type guard

pub fn can_use_skill_arg(args: &AgentRunArgs) -> bool {
    args.skill.is_none() || FeatureFlag::OzPlatformSkills.is_enabled()
}

Try / catch

match run_agent(ctx, opts, cmd) {
    Err(e) if e.to_string().contains("unexpected argument '--skill'") => {
        // inline the skill instructions into the prompt instead
    }
    result => result?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/073005a8716f6710. Report an issue: GitHub.