Skip to content

install crashes with an opaque ENOENT when a support directory has no installable files #899

Description

@williamthorsen

Problem

installSkillEntry (packages/agents/src/commands/install.ts) assumes a rendered skill directory always materializes on disk. When renderSkillDirectory returns zero entries — which happens for any content/skills/ support directory whose only contents are dotfiles or _partials/writeRenderedSkillDir creates nothing, and the immediately following injectMarkersInDirectory calls readdir on the never-created destination and throws an ENOENT that names neither the directory nor the empty-render cause.

Reproduce by leaving an otherwise-empty support directory (e.g. one holding only a .DS_Store) under content/skills/: install aborts and the install-smoke suite fails with the opaque error.

Proposed solution

Guard the empty-render case in installSkillEntry: when the rendered directory has zero entries, skip it — write no destination, attempt no marker injection, and record no manifest entry. Cleanup of any previously installed copy falls to the existing orphan-prune pass.

Not pursued: a fallback error at the marker-injection layer. With the guard in place, marker injection is never reached for an empty render, so such an error would name a cause that can no longer occur.

Acceptance criteria

Must have

  • install completes without error when a content/skills/ support directory renders to zero installable entries; the directory is skipped — no destination written, no marker injection attempted, no manifest entry recorded.
  • Regression coverage exercises the empty-render support-directory case.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions