Skip to content

fix: allow empty string for Expert description field#438

Merged
FL4TLiN3 merged 1 commit intomainfrom
fix/expert-description-empty-string
Jan 20, 2026
Merged

fix: allow empty string for Expert description field#438
FL4TLiN3 merged 1 commit intomainfrom
fix/expert-description-empty-string

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Remove .min(1) validation from expertSchema description field to allow empty strings
  • Add test case verifying empty string is accepted

Context

The description field in expertSchema had .min(1) validation which rejected empty strings ("") but accepted undefined. This caused issues with UI forms that typically send empty fields as empty strings rather than omitting them.

Before: z.string().min(1).max(1024 * 2).optional()

  • undefined - valid
  • "hello" - valid
  • "" - ZodError

After: z.string().max(1024 * 2).optional()

  • undefined - valid
  • "hello" - valid
  • "" - valid

This aligns with how description fields are handled in skill schemas (McpStdioSkill, McpSseSkill, InteractiveSkill), which use .optional() without .min(1).

Closes #437

Test plan

  • pnpm typecheck - passes
  • pnpm format-and-lint - passes
  • pnpm test - all unit tests pass
  • pnpm build - succeeds
  • CI passes

🤖 Generated with Claude Code

The expertSchema description field had `.min(1)` validation which
rejected empty strings but accepted undefined. This caused issues
with UI forms that typically send empty fields as "".

Changes:
- Remove `.min(1)` from description field in expertSchema
- Add test case for empty string description

Closes #437

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@FL4TLiN3 FL4TLiN3 merged commit 4ade10c into main Jan 20, 2026
9 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/expert-description-empty-string branch January 20, 2026 22:59
@FL4TLiN3 FL4TLiN3 mentioned this pull request Jan 20, 2026
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.

Fix: Expert description schema rejects empty string despite being optional

2 participants