agentscope-ai/agentscope · error · SkillUploadError

A skill may hold at most {MAX_FILE_COUNT} files, got {len(en

Error message

A skill may hold at most {MAX_FILE_COUNT} files, got {len(entries)}.

What it means

SkillUploadError raised when len(manifest.entries) exceeds MAX_FILE_COUNT (100). The ceiling bounds sandbox disk usage and how long a concurrency slot is held during install, per the constants at the top of _workspace.py.

Source

Thrown at src/agentscope/app/_service/_workspace.py:375

        Returns:
            `str`: The single top-level directory every path sits under.

        Raises:
            SkillUploadError: If a limit is exceeded, a path is unsafe,
                the paths span more than one root, no ``SKILL.md`` is
                present, or the parts do not match the manifest.
        """
        entries = manifest.entries
        if not entries:
            raise SkillUploadError("The upload contains no files.")
        if file_count != len(entries):
            raise SkillUploadError(
                f"The manifest lists {len(entries)} files but "
                f"{file_count} were sent.",
            )
        if len(entries) > MAX_FILE_COUNT:
            raise SkillUploadError(
                f"A skill may hold at most {MAX_FILE_COUNT} files, "
                f"got {len(entries)}.",
            )

        total = 0
        roots: set[str] = set()
        for entry in entries:
            if entry.size > MAX_FILE_BYTES:
                raise SkillUploadError(
                    f"{entry.path!r} is {entry.size} bytes, over the "
                    f"{MAX_FILE_BYTES}-byte per-file limit.",
                )
            total += entry.size

            parts = entry.path.replace("\\", "/").split("/")
            if len(parts) < 2 or any(p in ("", ".", "..") for p in parts):
                raise SkillUploadError(f"Unsafe upload path: {entry.path!r}")
            if entry.path.startswith("/"):

View on GitHub (pinned to e90f1c7592)

Solutions

  1. Exclude non-source directories (node_modules, .git, __pycache__, dist, .venv) from the pick/upload.
  2. Zip or vendor large dependencies elsewhere and reference them by URL from SKILL.md instead of shipping them.
  3. If the skill genuinely needs >100 files, split it into multiple skills or request a higher server-side MAX_FILE_COUNT.

Example fix

# before
entries = [e for e in all_entries]

# after
SKIP = {"node_modules", ".git", "__pycache__", ".venv", "dist"}
entries = [e for e in all_entries if not any(p in SKIP for p in e.path.split("/"))]
assert len(entries) <= 100
Defensive patterns

Strategy: validation

Validate before calling

MAX = 100
assert len(manifest.entries) <= MAX, f"{len(manifest.entries)} files; prune extras"

Prevention

When it happens

Trigger: Uploading a skill folder with more than 100 files — e.g. packaging node_modules, .git, virtualenvs, or build output inside the skill folder.

Common situations: No .gitignore-style exclusion on the client; picking a project root instead of the skill folder; generated artifacts or lockfile directories inflating the count.

Related errors


AI-assisted analysis of agentscope-ai/agentscope@e90f1c7592 (2026-08-28). Data as JSON: /api/errors/57f9bb8c2604956b. Report an issue: GitHub.