Skip to content

Give a package skill's slug the shape the skills API accepts - #688

Merged
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Chebaleomkar:fix/package-skill-slug-shape
Oct 2, 2026
Merged

davidmckayv merged 3 commits into
CopilotKit:mainfrom
Chebaleomkar:fix/package-skill-slug-shape

Conversation

@Chebaleomkar

Copy link
Copy Markdown
Contributor

What this changes

The comment above parseTenantSkills says "the shape the API enforces is enforced here too", but the patterns differ:

Where Pattern
tenant-package.ts:616 /^[a-z0-9][a-z0-9-]*$/
plugins/routes.ts:2143 (skills API) /^[a-z0-9][a-z0-9-]{0,38}[a-z0-9]$/
plugins/store.ts:2726 the same as the API
app/src/lib/skills/form.ts:20 the same as the API

So a package could seed a, a- or a sixty-character slug, and none of the other three would then accept or edit it. The package now uses the same pattern. The message keeps its existing prefix (skill.slug "…" must be lowercase …, which tenant-package.test.ts checks) and adds the length and the end rule.

Every slug in examples/fintech/skills.yaml already matches: find-a-document, find-a-notion-page, whats-changed, who-owns-this, check-a-claim, skill-creator, bot-creator.

Where it runs

  • Validation only. No state, replica, serialisation, fan-out, listener or schedule change.

Boundary and audit

  • Not touched.

Changelog

  • A line under Unreleased, because a custom package with such a slug is now refused at load.

Proof

  • tenant-package-agent-files.test.ts has a new table, and the file passes 15 of 15:
    • find-a-document, a1 and 40 characters are accepted;
    • a, a-, -a and 41 characters are refused.
  • The existing slug cases in tenant-package.test.ts pass 2 of 2 against Postgres.
  • tsc --noEmit on server/ exits 0, and biome is clean.

tenant-package.ts accepted /^[a-z0-9][a-z0-9-]*$/ while the skills route, the store and the app's form all require /^[a-z0-9][a-z0-9-]{0,38}[a-z0-9]$/, so a package could seed a slug like a, a- or sixty characters that none of them would accept or let anybody edit. The comment above the check already said the package enforces the API's shape.
davidmckayv
davidmckayv previously approved these changes Oct 2, 2026
@davidmckayv
davidmckayv enabled auto-merge (squash) October 2, 2026 02:14
auto-merge was automatically disabled October 2, 2026 11:11

Head branch was pushed to by a user without write access

davidmckayv
davidmckayv previously approved these changes Oct 2, 2026

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current head 86026bb matches the accepted source disposition from the refreshed triage. Required CI must pass before landing.

@davidmckayv
davidmckayv enabled auto-merge (squash) October 2, 2026 16:52
# Conflicts:
#	CHANGELOG.md
#	server/src/tenant-package.ts
@davidmckayv
davidmckayv merged commit a98cf53 into CopilotKit:main Oct 2, 2026
davidmckayv added a commit that referenced this pull request Oct 2, 2026
#686 wrote these two cases with the slug "s". #688 then required skill
slugs to be 2 to 40 characters, so the slug check refused "s" before the
duplicate check the tests assert on, and both cases failed on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants