Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(skills): raise bundled file limit from 50 to 200 (#78749)

Andrew Maguirec8c072c0ae91
diff --git a/products/review_hog/backend/reviewer/lazy_seed.py b/products/review_hog/backend/reviewer/lazy_seed.py
index 87ceecd004dd..e61c14a372a8 100644
--- a/products/review_hog/backend/reviewer/lazy_seed.py
+++ b/products/review_hog/backend/reviewer/lazy_seed.py
@@ -56,7 +56,7 @@ _ALLOWED_BUNDLE_SUBDIRS = ("references", "scripts")
# bypasses the service layer, so they're checked at parse time).
_MAX_SKILL_BODY_BYTES = 1_000_000
_MAX_SKILL_FILE_BYTES = 1_000_000
-_MAX_SKILL_FILE_COUNT = 50
+_MAX_SKILL_FILE_COUNT = 200
_MAX_SKILL_FILE_PATH_LENGTH = 500
# Stamped on `LLMSkill.metadata.seeded_by` for every ReviewHog-managed row. Its presence is the
diff --git a/products/signals/backend/scout_harness/lazy_seed.py b/products/signals/backend/scout_harness/lazy_seed.py
index aa7dd0ba5fb2..8308320d94fe 100644
--- a/products/signals/backend/scout_harness/lazy_seed.py
+++ b/products/signals/backend/scout_harness/lazy_seed.py
@@ -54,7 +54,7 @@ _ALLOWED_BUNDLE_SUBDIRS = ("references", "scripts")
# from this module's call sites. Keep the values in sync with skill_services.py.
_MAX_SKILL_BODY_BYTES = 1_000_000
_MAX_SKILL_FILE_BYTES = 1_000_000
-_MAX_SKILL_FILE_COUNT = 50
+_MAX_SKILL_FILE_COUNT = 200
# Matches `LLMSkillFile.path` model `max_length` — checked at parse time so an oversized
# canonical path fails with a clear error instead of a Postgres `value too long` DataError.
_MAX_SKILL_FILE_PATH_LENGTH = 500
diff --git a/products/signals/backend/test/test_scout_harness_lazy_seed.py b/products/signals/backend/test/test_scout_harness_lazy_seed.py
index 1027e75c81fd..01415701046f 100644
--- a/products/signals/backend/test/test_scout_harness_lazy_seed.py
+++ b/products/signals/backend/test/test_scout_harness_lazy_seed.py
@@ -10,6 +10,7 @@ from unittest.mock import patch
from products.signals.backend.models import SignalScoutConfig
from products.signals.backend.scout_harness.config_registry import register_missing_configs
from products.signals.backend.scout_harness.lazy_seed import (
+ _MAX_SKILL_FILE_COUNT,
CanonicalSkill,
CanonicalSkillFile,
CanonicalSkillParseError,
@@ -363,8 +364,8 @@ class TestDiscoverCanonicalSkills:
discover_canonical_skills(tmp_path)
def test_too_many_bundled_files_raises(self, tmp_path: Path) -> None:
- # File count limit mirrors MAX_SKILL_FILE_COUNT (50).
- bundled = {f"references/file_{i:03d}.md": f"# file {i}\n" for i in range(51)}
+ # File count limit mirrors MAX_SKILL_FILE_COUNT.
+ bundled = {f"references/file_{i:03d}.md": f"# file {i}\n" for i in range(_MAX_SKILL_FILE_COUNT + 1)}
_write_canonical_skill(
tmp_path,
dir_name="signals-scout-too-many",
@@ -377,7 +378,7 @@ class TestDiscoverCanonicalSkills:
body="# Body\n",
bundled_files=bundled,
)
- with pytest.raises(CanonicalSkillParseError, match="exceeding the 50 limit"):
+ with pytest.raises(CanonicalSkillParseError, match=f"exceeding the {_MAX_SKILL_FILE_COUNT} limit"):
discover_canonical_skills(tmp_path)
def test_overlong_path_raises(self, tmp_path: Path) -> None:
diff --git a/products/skills/backend/api/skill_serializers.py b/products/skills/backend/api/skill_serializers.py
index 2ecad4885f02..0f71471f3664 100644
--- a/products/skills/backend/api/skill_serializers.py
+++ b/products/skills/backend/api/skill_serializers.py
@@ -31,7 +31,7 @@ DEFAULT_VERSION_PAGE_SIZE = 50
_LIST_EXCLUDED_FIELDS = ("body", "body_total_length", "body_next_offset", "files")
MAX_SKILL_BODY_BYTES = 1_000_000
MAX_SKILL_FILE_BYTES = 1_000_000
-MAX_SKILL_FILE_COUNT = 50
+MAX_SKILL_FILE_COUNT = 200
# Ownership is a short routing list, not an ACL — cap it so a create/update can't resolve membership,
# clear the owner set, and insert an owner row per entry for an oversized input before being rejected.
MAX_SKILL_OWNERS = 25
diff --git a/products/skills/backend/api/skill_services.py b/products/skills/backend/api/skill_services.py
index 432e9ef0dbab..4997f9bddc09 100644
--- a/products/skills/backend/api/skill_services.py
+++ b/products/skills/backend/api/skill_services.py
@@ -18,7 +18,7 @@ from ..models.skills import (
MAX_SKILL_VERSION = 2000
MAX_SKILL_BODY_BYTES = 1_000_000
MAX_SKILL_FILE_BYTES = 1_000_000
-MAX_SKILL_FILE_COUNT = 50
+MAX_SKILL_FILE_COUNT = 200
class LLMSkillNotFoundError(Exception):
diff --git a/products/skills/backend/api/skills.py b/products/skills/backend/api/skills.py
index 41499aab6f4b..5154d7968808 100644
--- a/products/skills/backend/api/skills.py
+++ b/products/skills/backend/api/skills.py
@@ -98,7 +98,7 @@ from .skill_services import (
logger = structlog.get_logger(__name__)
-# Generous ceiling for an uploaded skill zip — per-skill content (body, 50 files × 1 MB) is
+# Generous ceiling for an uploaded skill zip — per-skill content (body, 200 files × 1 MB) is
# already bounded by create_skill, this just caps the upload before we read it into memory.
MAX_IMPORT_ZIP_BYTES = 10_000_000
diff --git a/products/skills/backend/api/test/test_skills.py b/products/skills/backend/api/test/test_skills.py
index c88fb5264814..46196f02cf32 100644
--- a/products/skills/backend/api/test/test_skills.py
+++ b/products/skills/backend/api/test/test_skills.py
@@ -230,7 +230,7 @@ class TestLLMSkillAPI(APIBaseTest):
"name": "many-files-skill",
"description": "Has too many files.",
"body": "# Body",
- "files": [{"path": f"file-{i}.txt", "content": "content"} for i in range(51)],
+ "files": [{"path": f"file-{i}.txt", "content": "content"} for i in range(201)],
},
format="json",
)
diff --git a/products/skills/backend/marketplace/packaging.py b/products/skills/backend/marketplace/packaging.py
index 2f33fdc78d4a..521e85dd8d27 100644
--- a/products/skills/backend/marketplace/packaging.py
+++ b/products/skills/backend/marketplace/packaging.py
@@ -29,9 +29,10 @@ SPEC_DESCRIPTION_MAX_LENGTH = 1024
# Zip-bomb defense for import: bound member count and per-member *decompressed* read so a small
# zip can't inflate into GBs of memory. These are coarse hard stops — the precise per-field/per-file
-# size caps are enforced downstream by the import validator. Kept comfortably above legit limits
-# (a SKILL.md body / bundled file is capped at ~1 MB each, ≤50 files).
-_MAX_ZIP_MEMBERS = 200
+# size caps are enforced downstream by the import validator. Member count is kept comfortably above
+# legit limits (≤200 bundled files plus SKILL.md and directory entries); the total is a memory stop
+# rather than a content limit, since MAX_IMPORT_ZIP_BYTES already bounds the compressed upload.
+_MAX_ZIP_MEMBERS = 500
_MAX_ZIP_MEMBER_BYTES = 2_000_000
_MAX_ZIP_TOTAL_UNCOMPRESSED_BYTES = 80_000_000
diff --git a/products/skills/frontend/llmSkillLogic.test.ts b/products/skills/frontend/llmSkillLogic.test.ts
index c7db981a6f16..912521cef6d4 100644
--- a/products/skills/frontend/llmSkillLogic.test.ts
+++ b/products/skills/frontend/llmSkillLogic.test.ts
@@ -77,13 +77,13 @@ describe('llmSkillLogic file uploads', () => {
)
})
- it('caps a folder drop at 50 files and says so instead of silently failing on publish', async () => {
- await upload(Array.from({ length: 55 }, (_, i) => asUpload(`content ${i}`, `references/file-${i}.txt`)))
+ it('caps a folder drop at 200 files and says so instead of silently failing on publish', async () => {
+ await upload(Array.from({ length: 205 }, (_, i) => asUpload(`content ${i}`, `references/file-${i}.txt`)))
- expect(logic.values.skillForm.files).toHaveLength(50)
- expect(logic.values.skillForm.files[49].path).toBe('references/file-49.txt')
+ expect(logic.values.skillForm.files).toHaveLength(200)
+ expect(logic.values.skillForm.files[199].path).toBe('references/file-199.txt')
expect(jest.mocked(lemonToast.error)).toHaveBeenCalledWith(
- "Some files weren't added: a skill can have at most 50 bundled files"
+ "Some files weren't added: a skill can have at most 200 bundled files"
)
})
})
diff --git a/products/skills/frontend/skillConstants.ts b/products/skills/frontend/skillConstants.ts
index 330f36ddf186..ecac06494eca 100644
--- a/products/skills/frontend/skillConstants.ts
+++ b/products/skills/frontend/skillConstants.ts
@@ -2,7 +2,7 @@ export const SKILL_NAME_MAX_LENGTH = 64
export const SKILL_DESCRIPTION_MAX_LENGTH = 4096
// Kept in sync with MAX_SKILL_FILE_BYTES and MAX_SKILL_FILE_COUNT in the backend skill_serializers.
export const SKILL_FILE_MAX_BYTES = 1_000_000
-export const SKILL_FILE_MAX_COUNT = 50
+export const SKILL_FILE_MAX_COUNT = 200
// Names that collide with reserved /skills routes: 'new' (the create form) and the category-tab
// slugs registered under /skills/<slug> in manifest.tsx. A skill with one of these names would be