Back to blog

OpenClaw PR #85850: A Superseded Successful Contribution

A merged PR that later had better alternatives. Learning notes on multi-layer defense, avoiding broad rules, and understanding complete data flow.

#OpenClaw#Open Source#PR#Learning

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:

LayerPRPurpose
Upstream prevention#85879source-config snapshot, prevents runtime defaults entering form
Gateway protection#85903Handles 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:

  1. Didn't check for existing PR first (NianJiuZst already did it)
  2. 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

PRResultNotes
#80773ClosedMaintainer overwrote without communication
#82683ClosedSecond submission, VP publicly apologized
#85850Mergedsteipete merged, gave contributor credit despite better alternatives
#85907ClosedProcess 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


Last updated: 2026-05-24