Issue #85831
Problem: Control UI incorrectly reports "Too small: expected string to have >=1 characters" when saving configuration with empty minLength-constrained string fields.
User Scenario:
User only wants to configure agentRuntime.id, not baseUrl (optional for OpenAI), but minLength: 1 validation blocks saving.
My Fix
Added logic in coerceFormValues():
if (typeof value === "string" && value.length === 0 && schema.minLength) {
return undefined;
}Converts empty strings to undefined, allowing fields to be omitted without triggering minLength validation.
PR: #85850(opens in a new tab)
ClawSweeper Review
After multiple re-reviews, final rating:
rating: 🐚 platinum hermit
proof: sufficient
status: 👀 ready for maintainer look
steipete merged the PR.
Superseded Explanation
After merging, steipete commented:
- #85879: Solves at source-config layer
- #85903: Gateway layer protection
- My approach: Too broad, may interfere with provider-specific required-field validation
Although superseded:
- PR was merged
- Commit record preserved
- Contributor status obtained
Lessons Learned
Multi-layer Defense vs Single-point Fix
steipete's approach has two layers:
| Layer | PR | Purpose |
|---|---|---|
| Upstream prevention | #85879 | source-config snapshot, prevents runtime defaults entering form |
| Gateway protection | #85903 | Handles complete payload with runtime-shaped defaults |
My approach had only one point (serialization boundary).
Multi-layer defense is more robust than single-point fixes.
Avoid Broad Rules
steipete explicitly noted:
"For this path we want to avoid a broad schema-form rule that turns every empty minLength string into an omitted value, since some provider fields still need owner-specific required-field validation."
My approach was too broad—converting all empty minLength strings to undefined could break provider-specific validation.
Target the problem scenario precisely, not with blanket rules.
Understand Complete Data Flow
My fix patched symptoms at downstream (serialization boundary).
Better approaches prevent at upstream.
Trace the complete data flow, find optimal intervention point.
About PR #85907
Attempted to fix Telegram preview issue, but:
- Didn't check for existing PR first (NianJiuZst already did it)
- Didn't create clean new branch (mixed in previous code)
PR closed by ClawSweeper as duplicate.
This was a process error, apologized to original author.
Comparison with Previous Events
| PR | Result | Notes |
|---|---|---|
| #80773 | Closed | Maintainer overwrote without communication |
| #82683 | Closed | Second submission, VP publicly apologized |
| #85850 | Merged | steipete merged, gave contributor credit despite better alternatives |
| #85907 | Closed | Process error, someone else did it first |
This experience was different:
- steipete communicated the reason
- Recognized the value of the attempt despite having better alternatives
Related Links
- PR #85850(opens in a new tab) — This contribution
- PR #85879(opens in a new tab) — source-config layer fix
- PR #85903(opens in a new tab) — gateway layer protection
Last updated: 2026-05-24