zeroclaw-labs/zeroclaw · error · anyhow::Error

runtime.kind='cloudflare' is not implemented yet. Use runtim

Error message

runtime.kind='cloudflare' is not implemented yet. Use runtime.kind='native' for now.

What it means

create_runtime maps RuntimeKind values to adapters; cloudflare is accepted by the config schema but has no runtime adapter yet, so construction bails with an explicit pointer at native. This is a schema-forward stub: parsing succeeds, then runtime creation fails fast.

Source

Thrown at crates/zeroclaw-config/src/platform/mod.rs:21

pub use docker::DockerRuntime;
pub use native::NativeRuntime;
pub use zeroclaw_api::runtime_traits::{RuntimeAdapter, ShellDialect, ShellProfile};

use crate::schema::{RuntimeConfig, RuntimeKind};

pub fn create_runtime(config: &RuntimeConfig) -> anyhow::Result<Box<dyn RuntimeAdapter>> {
    match config.kind {
        RuntimeKind::Native => {
            let shell = config.shell.clone().unwrap_or_else(|| "sh".into());
            #[cfg(unix)]
            validate_shell(&shell)?;
            #[cfg(windows)]
            validate_shell_windows(&shell)?;
            Ok(Box::new(NativeRuntime::with_shell(shell)))
        }
        RuntimeKind::Docker => Ok(Box::new(DockerRuntime::new(config.docker.clone()))),
        RuntimeKind::Cloudflare => anyhow::bail!(
            "runtime.kind='cloudflare' is not implemented yet. Use runtime.kind='native' for now."
        ),
    }
}

#[cfg(unix)]
fn validate_shell(shell: &str) -> anyhow::Result<()> {
    use std::os::unix::fs::PermissionsExt;

    // Android pins the shell to /system/bin/sh; the configured value is never
    // used, so don't reject it.
    if zeroclaw_api::platform::is_android() {
        return Ok(());
    }

    if shell.trim().is_empty() {
        anyhow::bail!("runtime.shell must not be empty or whitespace");
    }

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set runtime.kind = "native" (or "docker" for containerized execution).
  2. Remove the runtime.kind key to fall back to the default runtime.
  3. Track releases and retry when the cloudflare adapter actually ships.

Example fix

# before
[runtime]
kind = "cloudflare"

# after
[runtime]
kind = "native"
Defensive patterns

Strategy: type-guard

Validate before calling

if !is_implemented_runtime_kind(&cfg.runtime.kind) {
    return Err(anyhow::anyhow!("runtime.kind {:?} has no adapter in this build", cfg.runtime.kind));
}

Type guard

fn is_implemented_runtime_kind(kind: &str) -> bool {
    matches!(kind, "native" | "docker")
}

Try / catch

match create_runtime(&config) {
    Err(e) if e.to_string().contains("not implemented yet") => {
        // fall back to runtime.kind = "native" and warn the user
    }
    other => other,
}

Prevention

When it happens

Trigger: runtime.kind = "cloudflare" in config.toml passed to create_runtime — directly or via a runtime rebuild after config reload (as the factory tests exercise).

Common situations: Copying a config from docs or roadmap notes that mention cloudflare support; experimenting with enum values seen in error messages or autocomplete; stale configs from a fork that had a partial implementation.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/2525489c81bcb0cb. Report an issue: GitHub.