zed-industries/zed · warning · RuntimeError

Could not detect a working directory in the container. Set…

Error message

Could not detect a working directory in the container. Set EVAL_CLI_WORKDIR explicitly via --ae EVAL_CLI_WORKDIR=/path/to/repo

What it means

write_skill_to_disk stats {skills_dir}/{name} before creating anything and bails when a directory already exists at that path. The check exists so importing or creating a skill never silently overwrites an existing skill's directory.

Solutions

  1. Type a different skill name in the creator and save again
  2. Delete or rename the existing skill directory shown in the message, then retry
  3. If you meant to update the existing skill, edit its files in place instead of re-importing

Example fix

# before (terminal)
ls ~/.config/zed/skills/my-skill   # exists, blocks the import

# after (terminal)
mv ~/.config/zed/skills/my-skill ~/.config/zed/skills/my-skill-old
# then retry the import with name 'my-skill'
Defensive patterns

Strategy: validation

Validate before calling

// Before calling write_skill_to_disk, surface name collisions in the UI:
let target = skills_dir.join(name);
if fs.metadata(&target).await.ok().flatten().is_some_and(|m| m.is_dir) {
    show_inline_hint(&format!("A skill named {name} already exists — pick another"));
    return;
}

Prevention

When it happens

Trigger: Saving or importing a skill whose name matches an existing directory in the configured skills folder: fs.metadata(&skill_dir) returns Ok(Some(m)) with m.is_dir == true.

Common situations: Importing the same skill twice; a name that differs only by case on macOS/Windows (case-insensitive filesystems); a previously created skill the user forgot about; another tool that manages the skills directory created the same folder.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/b4a914d25e26770c. Report an issue: GitHub.

Appendix: source

Thrown at crates/eval_cli/zed_eval/agent_common.py:96

            '| head -1 | sed "s|/.git$||"'
        ),
    )
    workdir = (result.stdout or "").strip()
    if workdir:
        return workdir

    result = await exec_as_agent(
        environment,
        command=(
            "for d in /app /testbed /repo /root /home; do "
            '  if [ -d "$d" ]; then echo "$d"; exit 0; fi; '
            "done; pwd"
        ),
    )
    workdir = (result.stdout or "").strip()
    if workdir:
        return workdir
    raise RuntimeError(error_message)


def populate_context_from_result(logs_dir: Path, context: Any, logger: Any) -> None:
    result_data = None
    for json_file in logs_dir.rglob("result.json"):
        try:
            result_data = json.loads(json_file.read_text())
            break
        except (json.JSONDecodeError, OSError):
            continue

    if result_data is None:
        logger.warning("Could not find or parse result.json from eval-cli")
        return

    if result_data.get("input_tokens") is not None:
        context.n_input_tokens = result_data["input_tokens"]
    if result_data.get("output_tokens") is not None:

View on GitHub (pinned to f4178619ac)