warpdotdev/warp · error

The opencode harness is only supported for local child agent

Error message

The opencode harness is only supported for local child agent launches.

What it means

Thrown in run_agent for AgentCommand::Run (mod.rs:283): `--harness opencode` is rejected regardless of feature flags, because the opencode harness is only wired up for local child agent launches made by Warp itself, not for user-invoked `agent run`/`run-cloud` sessions. This is a semantic support check, distinct from the AgentHarness flag gate that fires just above it.

Source

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

) -> 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(
                    AgentDriverRunner::setup_and_run_driver(
                        spawner,
                        args,
                        server_api,
                        global_options.output_format,
                    ),

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Drop `--harness opencode` and use the default oz harness for CLI-initiated runs
  2. To run opencode, launch it directly or through Warp's local child-agent flow instead of `agent run`
  3. Use `--harness claude`/`codex`/`gemini` if you specifically need an external CLI harness and the AgentHarness flag is enabled

Example fix

# before
$ oz agent run --harness opencode "do a task"
Error: The opencode harness is only supported for local child agent launches.

# after
$ oz agent run "do a task"
Defensive patterns

Strategy: validation

Validate before calling

// Reject opencode before invoking the CLI:
anyhow::ensure!(
    args.harness != Harness::OpenCode,
    "opencode harness cannot be used via agent run; use a local child agent launch"
);

Type guard

pub fn harness_supported_here(h: Harness) -> bool {
    h != Harness::OpenCode // for CLI-initiated run/run-cloud paths
}

Try / catch

match run_agent(ctx, opts, cmd) {
    Err(e) if e.to_string().contains("opencode harness is only supported") => {
        // relaunch without --harness, or drive opencode directly
    }
    result => result?,
}

Prevention

When it happens

Trigger: Running `agent run --harness opencode ...` (flag on or off - the OpenCode check is unconditional and ordered after the flag gate). The Harness::OpenCode variant parses fine from the CLI enum; the driver path for it simply does not exist here.

Common situations: Users assuming all five harness values (oz/claude/opencode/gemini/codex) work everywhere; scripts copied from Warp's internal child-agent tooling; selecting opencode because the CLI is not installed locally.

Related errors


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