Skip to content

feat(ui): create Claws in the agent main chat - #173377

Merged
Patrick-Erichsen merged 6 commits into
mainfrom
claw-draft-review
Oct 20, 2026
Merged

Patrick-Erichsen merged 6 commits into
mainfrom
claw-draft-review

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Creators can already build a private Claw package, but the earlier creator UI moves them into a separate authoring session and a verbose review page. This change lets them turn the agent they are already chatting with into a shareable Claw, inspect the exact package in a compact modal, and publish only after an explicit click.

Summary

“Create a Claw” starts from the agent's right chat rail, its left-rail context menu, or agent settings. It sends a short manual skill command into that agent's existing main session. The agent prepares the proposal in the same conversation. Once ready, the creator reviews a compact, sectioned modal showing the exact archive files and declared requirements, can change the name and description or uncheck optional files/skills/plugins, and explicitly publishes. The chat then links to the ClawHub package with a pending-security-review message.

existing main chat → /skill create-claw → agent authors there → package modal → Publish

The earlier “Generate private draft” page and new/forked authoring session are removed. “Ask for changes” returns to the same chat; revised package contents require a new review. This layer uses the reviewed-package API in #173346.

Evidence

  • Before: The earlier creator UI created or forked a session, sent a long authoring prompt, and presented a raw draft review page. This was superseded before a safe real baseline screenshot was captured; the prior UI behavior remains in the PR's earlier commits and browser fixture.
  • After: Main chat with manual skill invocation and real Gateway package-review modal, recorded with a disposable sample agent. No real Claw was published during this walkthrough.
  • The current tests verify one /skill create-claw chat.send to the canonical main session, zero session creation/fork calls, review rebuilding after exclusions, exact archive bytes, explicit publication, and pending link. Added recovery tests cover Gateway replacement during creation, failed Create from Settings with retry, and failed Publish with a fresh review before retry. The creator browser suite is registered with its serial private-server owner; its ownership guard and both browser scenarios pass. Focused source tests, UI typecheck/build, formatting, and lint also pass.
  • Current-head authority receipt from product commit 135ac4f408: real signed WebSocket requests to its built Gateway and a loopback HTTP publication transport fixture. The active administrator caused 1 package POST; non-admin, synthetic plugin caller, disconnected caller, and revoked device-role caller each caused 0. This proves admission at the upload boundary; the fixture is not ClawHub and does not prove registry storage or finalization.
  • Earlier real local ClawHub end-to-end proof covered package storage, scan-gated discovery, Add, and ordinary-agent chat, with external scanner receipts simulated. The test walkthrough and recordings include live authoring and a clearly labeled simulated publish sequence. This Tailnet link is for the human reviewer; the screenshots and authority receipt above are publicly accessible to automated review.

The companion catalog Featured/category change is separately reviewable in #178047.

Merge Danger

Door: Two-way for UI; Publish is an explicit public action. Blast Radius: Administrator Claws UI behind the Labs flag. No migration or deployment is included. Do not merge before prerequisite #173346 lands.

@clawsweeper

clawsweeper Bot commented Oct 15, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Adds Claw creation in an agent’s existing main chat, editable package review, and explicit publication.

Example: Share the release-scout agent as @maker/release-brief.

  • Before: The catalog supports adding published Claws but provides no same-chat creation and package-review flow.
  • After: Create a Claw invokes the manual skill in the main chat, opens the package modal, and publishes the reviewed selection after an explicit click.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong visual and authority evidence supports the feature, but two concrete P2 defects block merge.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Inspected screenshots exercise the existing main chat and real Gateway package modal; signed-WebSocket and loopback-HTTP traces show an administrator upload and rejection before upload for non-admin, synthetic, disconnected, and revoked-device callers, while explicitly distinguishing the HTTP fixture from ClawHub storage.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Creators need to share an agent from its existing conversation while inspecting the exact package before publication.
Reason: Maintainer-authored direction reuses the merged package API and provides a coherent creation, review, and explicit-publication flow behind the existing Labs flag.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: it adds a useful maintainer-directed creation flow, but the prior publication-lock defect remains and review failures can hide their error text.

Priority: P2
Reviewed head: e812cfdaff396ba59ec409a3279161f0c4f87353

Before merge

  • Preserve the publication lock across review operations (P2) - While claws.drafts.publish is pending, publish() sets reviewCurrent=false and busy="publishing", exposing Refresh review. retryReview() reaches this method, which overwrites busy with "reviewing" and then clears it, enabling another Publish before the first upload settles. Name and description edits reach the same path through their debounce. Changing release-brief to release-brief-2 can therefore start two immutable package uploads, with either completion closing the other's modal. Preserve publication admission in the existing flow owner, block review/edit operations until settlement, and cover a deferred upload. This repeats the unresolved prior finding.
  • Render the stored error in the pre-modal failure notice (P2) - When the initial review fails, for example because the Gateway host requires clawhub login, error is populated while hasActiveDraft=true, modalOpen=false, and publication=null. This condition evaluates to boolean true, so the Show child receives true and {error()} displays no diagnostic text. The creator sees Retry review without the sign-in instruction needed to recover. Read view().read().error inside the notice or make the condition return the error string, and cover a failed initial review through the rendered UI.

Findings

  • [P2] Preserve the publication lock across review operations — ui/src/pages/claws/creator-flow.ts:246-250
  • [P2] Render the stored error in the pre-modal failure notice — ui/src/pages/claws/creator-review.tsx:224-227

Tests

  • Missing end-to-end proof: Supplied browser cases omit review or edits during a still-pending upload and a review failure before the first modal; red-on-base regression results are not shown.
Agent review details

How this fits together

Control UI entry points share a connection-scoped creator flow that invokes the existing chat and draft APIs; the Gateway builds reviewed archives and authorizes their upload to ClawHub.

flowchart LR
  A[Agent UI actions] --> B[Creator flow]
  B --> C[Existing main chat]
  C --> D[Private draft]
  D --> E[Package review modal]
  E --> F[Gateway publication owner]
  F --> G[ClawHub package]
Loading

Technical review

Best possible solution:

Keep the existing Gateway package owner, preserve the creator flow’s publication lock through settlement, and render the stored review error explicitly.

Do we have a high-confidence way to reproduce the issue?

Source establishes both failing paths: a review during pending publication clears the publication lock, and a pre-modal review failure renders a boolean instead of its message; no target code was executed.

Is this the best way to solve the issue?

The shared creator flow and existing draft APIs are appropriate; focused repairs to publication settlement and error rendering complete the implementation without another owner or public API.

Full review comments:

  • [P2] Preserve the publication lock across review operations — ui/src/pages/claws/creator-flow.ts:246-250
    While claws.drafts.publish is pending, publish() sets reviewCurrent=false and busy="publishing", exposing Refresh review. retryReview() reaches this method, which overwrites busy with "reviewing" and then clears it, enabling another Publish before the first upload settles. Name and description edits reach the same path through their debounce. Changing release-brief to release-brief-2 can therefore start two immutable package uploads, with either completion closing the other's modal. Preserve publication admission in the existing flow owner, block review/edit operations until settlement, and cover a deferred upload. This repeats the unresolved prior finding.
    Confidence: 0.99
  • [P2] Render the stored error in the pre-modal failure notice — ui/src/pages/claws/creator-review.tsx:224-227
    When the initial review fails, for example because the Gateway host requires clawhub login, error is populated while hasActiveDraft=true, modalOpen=false, and publication=null. This condition evaluates to boolean true, so the Show child receives true and {error()} displays no diagnostic text. The creator sees Retry review without the sign-in instruction needed to recover. Read view().read().error inside the notice or make the condition return the error string, and cover a failed initial review through the rendered UI.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 692a4d02d3ce.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/claws/creator-flow.test.ts --maxWorkers=1
  • pnpm test:ui:e2e ui/src/pages/claws/creator-review.e2e.test.ts
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit 94867f9 adds src/claws/draft-publish.ts:84 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 94867f9f8845; files: src/claws/draft-publish.ts)

PR surface

Source +930, Tests +424, Docs +27, Config +329, Other +15. Total +1725 across 25 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 16 962 32 +930
Tests 3 424 0 +424
Docs 2 29 2 +27
Config 3 329 0 +329
Generated 0 0 0 0
Other 1 15 0 +15
Total 25 1759 34 +1725

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Useful administrator-only Labs functionality has bounded publication-state and error-display defects.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-16T03:39:00.612Z sha 853e003 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-16T10:25:28.568Z sha 853e003 :: needs changes before merge. :: none
  • reviewed 2026-10-20T05:48:46.550Z sha 756309d :: needs real behavior proof before merge. :: [P2] Pass projected flow state into the review dialog | [P2] Retire pending creator state when the Gateway client changes | [P2] Display creation failures at non-chat entry points | [P3] Document the same-chat creation and modal review controls
  • reviewed 2026-10-20T06:12:17.438Z sha c29b051933b24a928a2b53cd62215c0509e70dc1 :: needs changes before merge. :: [P2] Register the current creator suite with its private-server owner
  • reviewed 2026-10-20T06:18:34.600Z sha c29b051933b24a928a2b53cd62215c0509e70dc1 :: needs changes before merge. :: [P2] Register the current creator suite with its private-server owner
  • reviewed 2026-10-20T06:29:04.990Z sha b9bb8593699992d63f2b19d29c0dc56c31b86a87 :: needs changes before merge. :: none
  • reviewed 2026-10-20T07:00:34.323Z sha bf1b95fcc2c0e6e7ead0737e3fca5b5f737a5270 :: needs changes before merge. :: none
  • reviewed 2026-10-20T07:18:11.810Z sha 590d0fb :: needs changes before merge. :: [P2] Preserve the publication lock across review operations

Reviewed October 20, 2026, 4:01 AM ET / 08:01 UTC (Revision 10).

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 20, 2026
Base automatically changed from agent-claw-drafts to main October 20, 2026 07:54
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 20, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit c9a7947 into main Oct 20, 2026
103 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the claw-draft-review branch October 20, 2026 08:12
steipete added a commit that referenced this pull request Oct 20, 2026
The create-claw skill invokes its bundled CLI bridge for skills and plugin inventory. Register the documented entry introduced by #173377 with Knip instead of treating it as an unused file.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
* docs(skill): guide same-session Claw authoring

* feat(ui): create and review Claws in the agent main chat

* test(ui): retain creator publication visual proof

* fix(ui): pass creator context into chat pane

* fix(ui): satisfy creator safety and mock checks

* fix(ui): use action cursor for Claw review controls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant