{"record":{"id":"b4a914d25e26770c","repo":"zed-industries/zed","slug":"could-not-detect-a-working-directory-in-the-contai","errorCode":null,"errorMessage":"Could not detect a working directory in the container. Set EVAL_CLI_WORKDIR explicitly via --ae EVAL_CLI_WORKDIR=/path/to/repo","messagePattern":"Could not detect a working directory in the container\\. Set EVAL_CLI_WORKDIR explicitly via --ae EVAL_CLI_WORKDIR=/path/to/repo","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"crates/eval_cli/zed_eval/agent_common.py","lineNumber":96,"sourceCode":"            '| head -1 | sed \"s|/.git$||\"'\n        ),\n    )\n    workdir = (result.stdout or \"\").strip()\n    if workdir:\n        return workdir\n\n    result = await exec_as_agent(\n        environment,\n        command=(\n            \"for d in /app /testbed /repo /root /home; do \"\n            '  if [ -d \"$d\" ]; then echo \"$d\"; exit 0; fi; '\n            \"done; pwd\"\n        ),\n    )\n    workdir = (result.stdout or \"\").strip()\n    if workdir:\n        return workdir\n    raise RuntimeError(error_message)\n\n\ndef populate_context_from_result(logs_dir: Path, context: Any, logger: Any) -> None:\n    result_data = None\n    for json_file in logs_dir.rglob(\"result.json\"):\n        try:\n            result_data = json.loads(json_file.read_text())\n            break\n        except (json.JSONDecodeError, OSError):\n            continue\n\n    if result_data is None:\n        logger.warning(\"Could not find or parse result.json from eval-cli\")\n        return\n\n    if result_data.get(\"input_tokens\") is not None:\n        context.n_input_tokens = result_data[\"input_tokens\"]\n    if result_data.get(\"output_tokens\") is not None:","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/eval_cli/zed_eval/agent_common.py#L78-L114","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Type a different skill name in the creator and save again","Delete or rename the existing skill directory shown in the message, then retry","If you meant to update the existing skill, edit its files in place instead of re-importing"],"exampleFix":"# before (terminal)\nls ~/.config/zed/skills/my-skill   # exists, blocks the import\n\n# after (terminal)\nmv ~/.config/zed/skills/my-skill ~/.config/zed/skills/my-skill-old\n# then retry the import with name 'my-skill'","handlingStrategy":"validation","validationCode":"// Before calling write_skill_to_disk, surface name collisions in the UI:\nlet target = skills_dir.join(name);\nif fs.metadata(&target).await.ok().flatten().is_some_and(|m| m.is_dir) {\n    show_inline_hint(&format!(\"A skill named {name} already exists — pick another\"));\n    return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List existing skill directories and offer auto-suffixed names (my-skill-2) on collision","Treat name uniqueness as part of the form validation, not just a write-time error"],"tags":["skill-import","filesystem","name-collision"],"backgroundTag":"directory-already-exists","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}