Skip to content

fix(templates): Template review and publish fail when the name or description has stray spaces - #197979

Merged
obviyus merged 3 commits into
openclaw:mainfrom
SunnyShu0925:fix/template-draft-review-choices-trim-387
Nov 16, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
SunnyShu0925:fix/template-draft-review-choices-trim-387

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reviewing or publishing a Template fails with invalid_manifest when 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 call client drives isolated real Gateways and a local HTTP registry fixture. On main, padded choices and a padded authored description both fail at review with invalid_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.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Trims 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. ".

  • Before: Review fails with invalid_manifest because the metadata contains surrounding whitespace.
  • After: Review and publication succeed with "Engineering Partner" and "A collaborative engineering partner.".

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused shared-owner repair with shipped-entry-point proof, baseline failures, preserved precedence controls, and no findings; broad CI has not finished.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The maintainer receipts exercise padded choices and an authored draft description through the shipped gateway-call client, real isolated Gateways, and HTTP publication, then inspect uploaded archives; precedence and blank-name controls also pass, and the final commit is formatting-only.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Template draft with stray spaces in otherwise valid review metadata cannot be reviewed or published.
Reason: The narrow repair makes accepted draft inputs usable without weakening manifest validation or changing publication authority.

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
Reviewed head: 542d92914d73e1b654824a503f496d0256d29fec

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Template display-name and description selection keeps the original intent (ab5a6d4: Preserve explicit CLAW.md names, use its description when the seeded draft description is empty, and retain explicit review clearing.)
  • Shared draft selection owner keeps the original intent (0843b94: Move private single-consumer draft-selection logic into its existing owner without changing public contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +3, Tests 0. Total +3 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 3 +3
Tests 2 3 3 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 9 6 +3

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Surrounding whitespace blocks review and publication of affected Template drafts, with impact limited to this authoring flow.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-13T00:09:59.231Z sha b0ad181bd87145c50a4275281ce96ac43d7455fa :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-13T01:26:28.075Z sha 0aaa1c0 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-13T03:38:02.319Z sha 0aaa1c0 :: needs maintainer review before merge. :: none

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.
@SunnyShu0925
SunnyShu0925 force-pushed the fix/template-draft-review-choices-trim-387 branch from b0ad181 to 0aaa1c0 Compare November 13, 2026 00:48
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 13, 2026
@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 13, 2026
@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added a proof image (Evidence section 4): the same padded draft and the same padded review choices through two isolated lanes, base 02f29597c10 vs head 0aaa1c0bc63. Base stops at the review with invalid_manifest: Value must not have leading or trailing whitespace.; head reviews to the trimmed display name and description, publishes, and the uploaded CLAW.md carries the trimmed values. Head commit is unchanged.

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Nov 13, 2026
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Maintainer proof for 542d92914d73e1b654824a503f496d0256d29fec.

Source tier, host through ocx: the shipped gateway call templates.drafts.* client drives real isolated Gateways through create → read → save → review → publish. Baseline main: 6688bc68b8d2e832feaaa5196c70e05ee9242546. The candidate source proof was collected at 094e729f8e8388114f6fd5327619bdaceaae3256; the final child commit changes expression wrapping only.

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.

Natural input Main Candidate
Padded review name and description invalid_manifest: Value must not have leading or trailing whitespace. Reviews and publishes Engineering Partner / A collaborative engineering partner.
Padded authored description, no review choices Same invalid_manifest Reviews and publishes A cited brief.
Untouched empty draft description Publishes authored name and manifest description Same
Explicitly cleared review description Publishes without agent description Same

The uploaded archives independently confirm all candidate outcomes. The controls preserve macOS Follow-up Desk verbatim, including capitalization and hyphen. The whitespace-only candidate display-name control falls back to that authored name and produces the same review token/artifact as the unmodified authored-name fallback.

Redacted terminal receipts:

base review: expected invalid_manifest
base review: expected invalid_manifest
base review: {"displayName":"macOS Follow-up Desk","description":"Authored manifest description."}
base publish: @maker/[email protected] published
base review: {"displayName":"macOS Follow-up Desk","description":""}
base publish: @maker/[email protected] published

candidate review: {"displayName":"Engineering Partner","description":"A collaborative engineering partner."}
candidate publish: @maker/[email protected] published
candidate review: {"displayName":"macOS Follow-up Desk","description":"A cited brief."}
candidate publish: @maker/[email protected] published
candidate review: {"displayName":"macOS Follow-up Desk","description":"Authored manifest description."}
candidate publish: @maker/[email protected] published
candidate review: {"displayName":"macOS Follow-up Desk","description":""}
candidate publish: @maker/[email protected] published

Vitest-source: both strengthened regression cases fail on the baseline for invalid_manifest. Candidate complete focused suites pass: 18 owner tests and 31 Gateway tests. Focused formatting and oxlint pass (0 warnings/errors).

The host-ocx safety check passes: only src/templates/draft.ts and its two test files differ from main; no package, lockfile, install-hook, patch or script changes. Production +6/-3; tests +3/-3, net 0. Merged #196644 precedence and its committed regressions are retained. The extra default-name test execution is consolidated with the existing Research Brief default assertion and the real-Gateway whitespace control.

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 ocx build --dts passed. The canonical tarball integrity check passed, and the tarball installed successfully into a fresh consumer with install lifecycle scripts disabled. With bundled-source fallback disabled, the installed executable reported OpenClaw 2026.11.3 (542d929) and templates draft created a real private proposal successfully. Consumer, tarball and workspace scratch were removed.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit b9bc0de into openclaw:main Nov 16, 2026
116 of 118 checks passed
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Landed in b9bc0de. Thanks @SunnyShu0925.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants