Repository navigation
fix(templates): Template review and publish fail when the name or description has stray spaces - #197979
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesTrims Template review display names and descriptions before building the publication archive. Example: Review a Template with displayName " Engineering Partner " and description " A collaborative engineering partner. ".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it fixes a current Template publication failure with a focused change, preserves the earlier metadata fixes, and has sufficient real-behavior proof. No actionable defects found; required CI remains in progress. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared draft preparation owner combines an agent-authored proposal with review choices, builds the validated archive, and supplies the same artifact preparation path to Gateway review and publication. flowchart LR
A[Private draft] --> C[Draft preparation]
B[Review choices] --> C
C --> D[Strict manifest validation]
D --> E[Reviewed archive]
E --> F[Gateway publication]
F --> G[ClawHub registry]
Technical reviewBest possible solution: Land the existing shared-owner normalization once required CI passes. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the accepted padded fields reaching strict manifest validation, and the supplied real-Gateway baseline receipts confirm invalid_manifest; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete fix: normalize the selected metadata in prepareTemplateDraft, which already owns both reviewed and published archives, while retaining strict validation and existing precedence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 25c97908924a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +3, Tests 0. Total +3 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 16, 2026, 12:45 AM ET / 05:45 UTC (Revision 4). |
…ding the manifest prepareTemplateDraft copied the review choices straight into the CLAW.md manifest, while the manifest schema rejects leading or trailing whitespace. A padded displayName or description made templates.drafts.review and templates.drafts.publish fail with invalid_manifest without naming the field.
b0ad181 to
0aaa1c0
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Added a proof image (Evidence section 4): the same padded draft and the same padded review |
|
🦞👀 Re-review progress:
|
|
Maintainer proof for Source tier, host through ocx: the shipped The local HTTP registry fixture implements whoami and package publication, checks the actual multipart archive's SHA-256 against the Gateway's submitted digest, and extracts the uploaded CLAW.md. It does not replace any Gateway handler, hold replies, inject faults, or publish to a public registry. All credentials are synthetic fixture values.
The uploaded archives independently confirm all candidate outcomes. The controls preserve Redacted terminal receipts: Vitest-source: both strengthened regression cases fail on the baseline for The host-ocx safety check passes: only Both Gateways, the local registry and task-owned runtime state were stopped and removed. Baseline scratch was removed with ocx gc. Full tier and packed smoke: final-head |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in b9bc0de. Thanks @SunnyShu0925. |
…cription has stray spaces (openclaw#197979) fix(templates): trim template name and description before review and publish Template review and publish rejected a template whose name or description had leading or trailing spaces, even though the same metadata was accepted when the draft was created, so a valid draft could never be published. Review and publish now use the same trimmed values the draft accepted, keeping the precedence from openclaw#196644. No new text. Evidence: a natural publish run through a local registry, twice per side: main rejects both padded paths; this change publishes four digest-verified archives. The openclaw#196644 precedence controls behave the same on both. 49 tests pass; lint, full build and fresh-consumer packed smoke pass. Receipts: openclaw#197979 (comment). Thanks @SunnyShu0925. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Reviewing or publishing a Template fails with
invalid_manifestwhen an accepted review display name or description contains surrounding whitespace. An agent-authored draft description ending in a space fails before the user can publish it.Solution
Trim the selected display name and description before building the reviewed manifest. Keep the manifest schema strict and retain the contributor's commits.
Integrate current main to resolve the collision with merged #196644. Its precedence is preserved: explicit CLAW.md names retain their capitalization and punctuation; an untouched empty draft description falls back to the manifest; an explicitly cleared review description stays empty. A blank normalized review name falls back to the authored name or existing slug-derived default.
Production is +6/-3 lines. Tests are +3/-3 (net 0), strengthening the existing owner and Gateway publication cases. The added duplicate default-name assertion is removed: the existing slug/default case still asserts
Research Brief, and the real-Gateway control separately verifies whitespace-only name fallback.Evidence
The shipped
gateway callclient drives isolated real Gateways and a local HTTP registry fixture. On main, padded choices and a padded authored description both fail at review withinvalid_manifest. The candidate reviews and publishes both successfully; the registry checks the actual multipart artifact digest and extracts the uploaded CLAW.md to verify trimmed metadata.Controls on both sides preserve
macOS Follow-up Desk, the authored manifest description when the draft description is untouched, and an explicitly cleared description. A candidate whitespace-only display name produces the same reviewed artifact as the authored-name fallback. No public registry or real credentials are used.The strengthened owner and Gateway regressions both fail on main. Candidate focused suites pass: 18 owner cases and 31 Gateway cases. Formatting and focused lint are clean.
Two-way door: reverting restores rejection of padded metadata. No schema, identity, authority, configuration or storage change; only newly reviewed Template metadata is normalized.
The final head also passes a full declaration build, canonical tarball integrity check, and fresh-consumer installed-CLI smoke with source fallback disabled.
Maintainer proof receipts.