Skip to content

fix(ui): support slash commands and skills inside normal drafts - #122425

Merged
jesse-merhi merged 12 commits into
mainfrom
fix/inline-slash-skills
Aug 26, 2026
Merged

jesse-merhi merged 12 commits into
mainfrom
fix/inline-slash-skills

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Slash completion in the Control UI disappeared as soon as a draft contained ordinary prose. Users had to erase the draft or send the slash text as part of the model message. This PR makes the slash token at the cursor behave like its standalone command while preserving the surrounding draft, and keeps skills on the existing $skill path. It also rejects invalid explicit skill references before applying /model or other directives, so an error cannot mutate session state.

Maintainer decision

Accepted for merge: a recognized inline slash command is an intentional composer action. It dispatches through the normal command path while the surrounding prose remains as an unsent draft.

Change breakdown

Part Files +LOC -LOC
Control UI composer 9 +489 -26
Reply and skill routing 4 +126 -71
Tests and fixtures 9 +817 -5
Documentation 1 +3 -0
Total 23 +1435 -102

Proof

Same input and mock Gateway fixture at 1280x800 on direct base 7aef0336574 and this PR at 3703e232ffe.

Before: direct base

Input: Keep this /exec gateway + Enter
Slash menu visible: false
Sent message: Keep this /exec gateway
Remaining draft: ""

After: PR

Input: Keep this /exec gateway + Enter
Sent command: /exec gateway
Remaining draft: "Keep this "
Model message from surrounding prose: none

Input: Please use /wea + select /weather
Remaining draft: "Please use $weather "

Visual proof

Before Enter, the whole draft is still in the composer:

Control UI composer containing Keep this slash exec gateway

After Enter, only /exec gateway is sent and Keep this remains in the composer:

Control UI showing slash exec gateway sent separately while Keep this remains in the composer

How to verify

  1. Type Keep this /exec gateway, then press Enter. The command sends separately and the draft becomes Keep this .
  2. Type Keep this /reset, then select /reset. The normal reset confirmation and permission checks still apply; the draft remains Keep this .
  3. Type Please use /wea, then select /weather. The draft becomes Please use $weather .

Boundaries

  • Inline commands use the same handler, permissions, and confirmations as standalone commands.
  • A composer without a connected command owner does not offer or dispatch inline commands.
  • Skills remain $skill references for the model turn.
  • Invalid or oversized explicit skill references return before session directives can change state.

Copilot AI lite review requested due to automatic review settings August 12, 2026 04:13
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 9:52 AM ET / 13:52 UTC.

ClawSweeper review

What this changes

The PR lets the Control UI dispatch a selected slash command from within prose while keeping the remaining draft editable, and converts selected skills to existing $skill references.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. The maintainer-authored, automerge-armed PR has no concrete correctness or security finding in the reviewed source; it should proceed only when exact-head required checks complete.

Priority: P2
Reviewed head: 499956e8e0b91d222e6ceaaf21dedfa3bc15bddf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The PR has strong interaction evidence and broad focused coverage, with exact-head CI still pending.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER PR; its body nevertheless supplies before/after Control UI screenshots and a mock-Gateway trace of the changed interaction.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER PR; its body nevertheless supplies before/after Control UI screenshots and a mock-Gateway trace of the changed interaction.
Evidence reviewed 6 items Current-main gap: Current main only opens slash completion for a draft matching a whole-command prefix, so prose before a slash token cannot open the menu; the PR replaces that with caret-aware token detection.
Command owner boundary: The PR dispatches the extracted command through the existing page-level send handler while the composer commits only the residual draft; the normal command, permission, confirmation, and recovery path remains the owner.
Interaction and sibling coverage: Focused UI tests cover selected commands, typed arguments, aliases, modifier-enter behavior, trailing prose, unavailable command owners, and skill insertion; the browser E2E test verifies the Gateway receives only the command and the composer retains the prose.
Findings None None.
Security None None.

Live Verification

Command: pnpm test ui/src/e2e/chat-thinking-arguments.e2e.test.ts

Result: FAIL (failed) — step 1 run pnpm test ui/src/e2e/chat-thinking-arguments.e2e.test.ts: previous terminal command was still running after 30 seconds: "pnpm test ui/src/e2e/chat-thinking-arguments.e2e.test.ts"

$ node --import tsx scripts/test-projects.mts ui/src/e2e/chat-thinking-arguments.e2e.test.ts
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-122425-djX1yN/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-122425-djX1yN/target

Assertions:

  • FAIL expect_output: executes inline /exec gateway separately from the draft

How this fits together

The Control UI composer detects slash tokens in a draft, then either dispatches a command through the normal Gateway chat-send path or inserts a skill reference for the eventual model turn. The remaining draft stays in the composer instead of being sent as model input.

flowchart LR
  A[Control UI draft] --> B[Inline slash detection]
  B --> C{Command or skill selected?}
  C -->|Command| D[Existing chat command path]
  C -->|Skill| E[Insert skill reference]
  D --> F[Gateway command handling]
  E --> G[Model message on later send]
  D --> H[Remaining editable draft]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head checks for 499956e are still incomplete; existing automerge must wait for their required green result.
  • Resolve merge risk (P1) - The isolated autoreview helper could not inspect the full branch because this shallow checkout lacks a merge base with current main; this does not invalidate the PR’s supplied proof.
  • Complete next step (P2) - No discrete repair is identified; wait for the normal exact-head CI gate rather than opening a fix lane.
Agent review details

Security

None.

PR surface

Source +531, Tests +850, Docs +3. Total +1384 across 26 files.

View PR surface stats
Area Files Added Removed Net
Source 14 651 120 +531
Tests 11 856 6 +850
Docs 1 3 0 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 26 1510 126 +1384

Review metrics

Metric Value Why it matters
Production versus test delta production +651/-120; tests +856/-6; docs +3/-0 The production growth implements a new composer interaction and its command/skill routing boundary; the larger test delta covers its UI and reply-path behavior.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/session-suggestions.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the existing implementation through the armed automerge path after its exact-head checks are green; no replacement design or repair is indicated.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the existing implementation through the armed automerge path after its exact-head checks are green; no replacement design or repair is indicated.

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

Yes—current main’s slash-menu matcher only recognizes a command-style draft, while the PR’s targeted browser E2E covers prose plus an inline command and the preserved residual draft.

Is this the best way to solve the issue?

Yes—the UI removes only the selected token and invokes the existing command owner, avoiding a parallel permission or dispatch path; skills remain model references rather than immediate commands.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d259f982e4e1.

Labels

Label justifications:

  • P2: This is a bounded Control UI command-composer improvement with no evidence of data loss, security failure, or core availability impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER PR; its body nevertheless supplies before/after Control UI screenshots and a mock-Gateway trace of the changed interaction.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary external-contributor proof gate does not apply to this MEMBER PR; its body nevertheless supplies before/after Control UI screenshots and a mock-Gateway trace of the changed interaction.

Evidence

What I checked:

  • Current-main gap: Current main only opens slash completion for a draft matching a whole-command prefix, so prose before a slash token cannot open the menu; the PR replaces that with caret-aware token detection. (ui/src/pages/chat/components/chat-composer-slash-menu.ts:144, d259f982e4e1)
  • Command owner boundary: The PR dispatches the extracted command through the existing page-level send handler while the composer commits only the residual draft; the normal command, permission, confirmation, and recovery path remains the owner. (ui/src/pages/chat/components/chat-composer-slash-menu.ts:251, 499956e8e0b9)
  • Interaction and sibling coverage: Focused UI tests cover selected commands, typed arguments, aliases, modifier-enter behavior, trailing prose, unavailable command owners, and skill insertion; the browser E2E test verifies the Gateway receives only the command and the composer retains the prose. (ui/src/pages/chat/chat-view.test.ts:3833, 499956e8e0b9)
  • Skill and directive safety: Explicit skill references are resolved before directive routing, preventing a referenced-skill payload from applying model directives; tests cover both opaque referenced payloads and invalid-reference rejection before state mutation. (src/auto-reply/reply/get-reply-directives.ts:271, 499956e8e0b9)
  • History and ownership limitation: Current-main blame reaches a shallow promisor boundary attributed to xingzhou; deeper feature history could not be read because the checkout cannot fetch missing objects, so ownership is low confidence. (ui/src/pages/chat/components/chat-composer-slash-menu.ts:144, d259f982e4e1)
  • Repository integrity and review-helper limitation: The diff is whitespace-clean and the checkout remains clean. The requested isolated autoreview helper was attempted but could not construct a three-dot diff because this shallow checkout has no merge base for current main. (499956e8e0b9)

Likely related people:

  • xingzhou: The available current-main blame output attributes the pre-PR composer and command-helper lines to this author, but shallow history prevents a reliable feature-history trace. (role: current-main blame boundary; confidence: low; commits: ef26489a5969; files: ui/src/pages/chat/components/chat-composer-slash-menu.ts, ui/src/lib/chat/commands.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the required exact-head checks to complete before the armed automerge path lands the PR.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (72 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-26T08:47:27.828Z sha 9745ca6 :: needs changes before merge. :: [P2] Synchronize typing presence after inline dispatch
  • reviewed 2026-08-26T09:26:50.531Z sha 502c0ac :: needs changes before merge. :: [P2] Publish typing after inline dispatch
  • reviewed 2026-08-26T09:57:35.342Z sha 502c0ac :: needs changes before merge. :: [P2] Publish typing when mutating an inline draft
  • reviewed 2026-08-26T10:19:07.284Z sha 30eaa14 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T10:41:12.269Z sha 30eaa14 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T11:06:14.648Z sha 30eaa14 :: needs changes before merge. :: [P2] Consume the complete inline argument token
  • reviewed 2026-08-26T13:01:18.857Z sha c5b6ab1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T13:30:07.900Z sha ece5716 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 12, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 12, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 12, 2026
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Resolve merge risk (P1) - Inline /reset, /model, and similar commands intentionally affect the active session while adjacent prose remains unsent; the accepted product behavior needs exact-head CI to finish be... (sha=30eaa143dfe6c8bcce6f875740cd2b54242eedb5)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper approve

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper fix ci

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper picked this up.

Command: fix ci
Action: repair worker queued. Run: https://github.com/openclaw/clawsweeper/actions/runs/32962291640

I will keep the change narrow and update the PR branch if the repair worker finds a safe fix.

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Resolve merge risk (P1) - The structured autoreview gate could not run in this read-only environment because TruffleHog is unavailable; retain exact-head CI and targeted UI verification before merge. (sha=c5b6ab10dd7821f4c4832db3778b96303491f2a6)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

# Conflicts:
#	ui/src/pages/chat/components/chat-composer-keydown.ts
@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper approve

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Resolve merge risk (P1) - Exact-head checks for 499956e are still incomplete; existing automerge must wait for their required green result. (sha=499956e8e0b91d222e6ceaaf21dedfa3bc15bddf)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

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 clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper:human-review Needs maintainer review before ClawSweeper can continue clownfish:automerge Maintainer opted this Clownfish PR into bounded ClawSweeper-reviewed automerge commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. r: skill Auto-close: skills should be published on ClawHub, not added to core. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants